Thread View: borland.public.jbuilder.java.language
3 messages
3 total messages
Started by Matthew
Mon, 02 May 2005 19:22
Help with decimals precision?
Author: Matthew
Date: Mon, 02 May 2005 19:22
Date: Mon, 02 May 2005 19:22
7 lines
1197 bytes
1197 bytes
I am trying to convert a string with a value like '012300' to a decimal value like '123.00'. I have tried coverting it into a float, but all I get back is '123.0' and I need both zeros at the end. Can anyone help me? Matthew
Re: Help with decimals precision?
Author: Arthur Ore
Date: Mon, 02 May 2005 19:37
Date: Mon, 02 May 2005 19:37
19 lines
1421 bytes
1421 bytes
I think the DecimalFormat class will do what you want. http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html Arth -- Arthur Ore Sun Certified Java Programmer "Matthew" <NO@NO.com> wrote in message news:42767e3f$1@newsgroups.borland.com... >I am trying to convert a string with a value like '012300' to a decimal >value like '123.00'. I have tried coverting it into a float, but all I get >back is '123.0' and I need both zeros at the end. > > Can anyone help me? > > Matthew
Re: Help with decimals precision?
Author: Matthew
Date: Mon, 02 May 2005 19:42
Date: Mon, 02 May 2005 19:42
7 lines
1249 bytes
1249 bytes
Arthur Ore wrote: > I think the DecimalFormat class will do what you want. > > http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html > > Arth Yes, that looks like it. Thanks.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads