http://stackoverflow.com/questions/5236056/force-decimal-point-as-seperator-in-java

On Thu, Jan 26, 2012 at 8:05 AM, RLScott <[email protected]> wrote:
> My app writes files with strings generated by code like:
>
> s = String.format("%6.2f\r\n", zValue);
>
> where zValue is a float.  Then it reads those files back in later and
> parses them, expecting to see a number with a decimal point (.).  This
> works fine for my phone and for all the Android devices in the US that
> I have tested.  But now a user from Germany reported troubles that I
> have traced down to the fact that on German phones, the above
> statement produces numbers that use the comma (,) as the decimal
> delimiter, and so my parsing code that looks for decimals with periods
> does not work.  It appears to be a localization issue.  How can I
> force all my strings generated with ".format" to use US localization
> standards in this regard?  (My files are totally for internal use by
> the app and so do not need to be rendered in the local convention.)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in DC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to