locked
A Number Seperator check that work across languages, regardless of endusers keyboard languge selection.

    Question

  • Hi !

    I have this Universal App. 

    The app Reads content from within two textboxes, does a Parse to two doubles. Then runs a Method on the double pair and again it returns a double result.

    And from early on - I have a hard time in making it "input safe", in regards to number separators, which seem to fail, when language keyboard is different from regional settings?!

    My optimal solution is to check my input if it has either "," | "." and then overrides both with replacing either with "." - Which should make sure the app works with any language and any keyboard settings.

    Any pointers in any direction would be greatly appreciated.

    And thanks for taking the time to read about my issue.

     


    Regards, Kato.

    Friday, July 25, 2014 9:25 PM

Answers

  • Why do you want a custom number separator? You can specify which NumberFormatter you want to use rather than relying on the default for the culture, but if you want to mix and match you'll need to decide how you want that to work and implement this yourself.

    Mixing cultural settings won't work in general as one culture's decimal separator is another culture's thousand's separator. Some regions will use a character other than "," or "."

    --Rob

    Saturday, July 26, 2014 6:23 AM
    Owner