cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conal Tuohy <con...@paradise.net.nz>
Subject RE: decimal formatting
Date Fri, 28 Jan 2005 10:20:50 GMT
> Gunter D'Hondt wrote:
> > I've also tried a plain java program and call it like this:
> > java -Duser.language=fr  -Duser.country=FR  -Duser.variant=FR Main
> >
> > java program:
> > public class Main {
> >
> >     public static void main(String[] args) {
> >
> >         double d=123.45;
> >         System.out.println("d="+d);
> >     }
> > }
> >
> > as you say this would output "d=123,45" but it always
> outputs "d=123.45"

> From: John L. Webber

> Have you tried using javax.swing.text.NumberFormatter?

I think John is right. You may have the Locale installed but not be using
it. System.out.println just ends up calling Double.toString(d) which is
really a canonical serialization of a double, not a locale-specific
rendering.
http://java.sun.com/j2se/1.3/docs/api/java/lang/Double.html#toString(double)

Con


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message