I want to handle multiple currency formats in a textField which accepts a currency entry. Example: $13,245.12
If the user enters this value as the string: "13245.12" then converting it to a double works fine. However, if the user enters "13,245.12" the conversion to Double results in 'nil'.
If the original entry is "13245.12" and after conversion to a Double and then application of the NumberFormatter() we get "$13,245.12" as expected. However if the user needs to edit the value to "$13,555.12" then this value again gets converted to 'nil' when we attempt to get a Double.
Although its easy enough to remove the $ and , in code we still have an issue if we use the same code for other language formats unless we have language specific code - which seems to defeat the whole purpose of the NumberFormatter(). What is the best practice since this seems like a pretty basic issue regarding Localization for Apps that accept currency values?
Post
Replies
Boosts
Views
Activity
I exported strings from an iOS App to create a Xcloc with an fr.xliff file.
Using the XLIFF App I an adding translated test to the target column, and when I translate: "Using the slider you can set image dimensions in 10% increments.
I get this error: Validation Error "Target does not contain all format characters from the source, missing "% i".
Is the issue here the use of % in the original text?
I created a localization to French. Translated content for Main.strings, Localizable.strings, and InfoPlist.strings in XLIFF and then imported using Xcode. All storyboard and code strings appear correctly, but the InfoPlist.strings, while listed correctly in the imported file InfoPlist.strings - does not display in French. It displays in English. Guidance?