Results 1 to 7 of 7

Thread: Better Number Parsing

  1. #1
    Member
    Join Date
    Aug 2015
    Posts
    44

    Better Number Parsing

    Can you add support to parse commas (,) and maybe periods (.) at 3 digit number groups (ie 1,000) for aid, military training, and war room?

    I occasionally copy and paste values from systems and tool (ie: a calculator) into those pages, and then have to go and remove the commas to execute the command. Would be nice user friendly feature to optionally support and allow those characters in the correct locations.

    Thanks

  2. #2
    Sir Postalot Pillz's Avatar
    Join Date
    Jul 2008
    Location
    Sinners NA
    Posts
    3,351
    +1

    So annoying copying def from a som or sot Ingame and pasting it in the war room and having to manually remove the comma.

  3. #3
    Forum Fanatic
    Join Date
    Sep 2008
    Posts
    2,661
    I suspect it would be tricky to manage given the difference between EU and US methods of comma vs period in numbers.

  4. #4
    Forum Fanatic Elldallan's Avatar
    Join Date
    Dec 2009
    Posts
    2,018
    Quote Originally Posted by Zauper View Post
    I suspect it would be tricky to manage given the difference between EU and US methods of comma vs period in numbers.
    +1
    I'd prefer the way it currently is over a US centric change.

    I'm not sure how you'd code it but maybe it's possible to fetche the country setting from the users browser?

    Quote Originally Posted by Pillz View Post
    +1

    So annoying copying def from a som or sot Ingame and pasting it in the war room and having to manually remove the comma.
    So let's remove the comma from som's or sot's instead and make it neural.
    Build a man a fire and he'll be warm for a day, Set a man on fire and he'll be warm for the rest of his life.

  5. #5
    Member
    Join Date
    Aug 2015
    Posts
    44
    I assume there should be a fairly simple regular expression to do the client side validation, and then just strip the characters on the server side.

    On the US centric statement, it's either already us centric and supporting the (probably wrong) US standard would make some sense. Or the game is properly using locale to display numbers and should support input in that same locale.

    I totally agree the game should support locale standards for display and input.

  6. #6
    Sir Postalot Pillz's Avatar
    Join Date
    Jul 2008
    Location
    Sinners NA
    Posts
    3,351
    Using periods over commas disqualifies you from personhood.

  7. #7
    Member
    Join Date
    Aug 2015
    Posts
    44
    lets not fight over commas, periods or spaces. I'll gladly agree the Imperial measurement system is terrible.

    But from what I can gather from inspecting the client side code, utopia already submits the aid page's input with commas, periods, and spaces to the server. A web server should have no problems handling the various ways a number could legitimately look like.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •