[android-developers] using java decimal formatter outside USA
Hello All,
I am running into an issue with some of my European users. To
demonstrate the issue I isolated the following three lines of code:
float gb = 0;
DecimalFormat dfm = new DecimalFormat( "#,###,###,##0.0" );
float mTotalRamInstalled = (float) new
Float(dfm.format(gb)).floatValue();
I am trying to get 0.0 as my output (in this case--its actually part
of a function where gb is passed in).
When I set the emulator language to English (USA) it works fine. But
several other countries, for example Deutsch (Schweiz), the
application blows up with number format exception. Can anyone give
me some pointers as to what is happening and how I should be handling
this as obviously I am doing it wrong.
Thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home