Salut Ludo !
If you wish to format a number, depending on a
specified locale, you can convert your Float with some classes found in the
java.text package. You can specify a pattern for the resulting
String.
DecimalFormat nf =
(DecimalFormat)DecimalFormat.getInstance(Locale.FRENCH);
nf.applyPattern("#,##0.00"); // this pattern is very usefull for just keeping
two digit for the decimal part (especially when dealing with
currencies
Float myFloatNumber = 123456789.123456
String myFormattedString =
nf.format(myFloatNumber);
// myFormattedString will be equal to "123 456
789,12" in the locale is French
// and it will be equal to "123,456,789.12" if
the locale is English
Guillaume
|
- Basic-link Meena
- display numbers ludovic . maurillon
- Re: display numbers Guillaume Laforge
- Re: display numbers ludovic . maurillon
- RE: display numbers Peter Jacobs
- Re: display numbers Christopher R. Maden
- Basic-link Meena
- RE: basic-link Vasantha . Nataraju
- Re: basic-link Rodolphe VAGNER
- one letter words Michal Kwiatek
- Re: basic-link J.Pietschmann