Re: Weird Problem w/ DecimalFormat
From: Andy Fish (ajfish_at_blueyonder.co.uk)
Date: 05/11/04
- Next message: Andy Fish: "Re: Question about parsing xml attributes using DOM"
- Previous message: Rogan Dawes: "Re: Pasting a file into a Java String"
- In reply to: Thomas Weidenfeller: "Re: Weird Problem w/ DecimalFormat"
- Next in thread: Fred: "Re: Weird Problem w/ DecimalFormat"
- Reply: Fred: "Re: Weird Problem w/ DecimalFormat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 11 May 2004 09:21:08 GMT
"Thomas Weidenfeller" <nobody@ericsson.invalid> wrote in message
news:c7q002$fvf$1@newstree.wise.edt.ericsson.se...
> Cliff wrote:
> > The following code snippet:
> >
> > static DecimalFormat nf=new DecimalFormat("#####.00");
> > System.out.println(nf.format(1000.10));
> >
> > sometimes stops working properly
>
> Sounds like it works as advertised.
>
> > and instead of seeing 1000.10 I see 1000,10
> > (note the comma). I can't for the life of me figure out what is going
on...
> > I'm using Java 1.3.1 on a Sun workstation.
>
> Check the settings of your locale (LANG and LC_ environment variables,
> etc.). Not everyone in the world uses the '.' as the decimal delimiter.
I think you need to define "sometimes". I would be very surprised if it
behaves this way intermittently in a consistent environment. Once you have
figured out the difference in environment you have the answer.
Often these kind of things work one way when you run it in the development
environment or when loggged on interactively, but a different way when you
install it in the services control panel (NT), or have it run as an rc
script (*x)
>
> /Thomas
- Next message: Andy Fish: "Re: Question about parsing xml attributes using DOM"
- Previous message: Rogan Dawes: "Re: Pasting a file into a Java String"
- In reply to: Thomas Weidenfeller: "Re: Weird Problem w/ DecimalFormat"
- Next in thread: Fred: "Re: Weird Problem w/ DecimalFormat"
- Reply: Fred: "Re: Weird Problem w/ DecimalFormat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|