Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
stop the double type value up to 2 or 3 decimal
Joined: Aug 19, 2001
Aug 21, 2001 06:19:00
answer will com like this
but i want
how it could be possible
send me excercises about <BR>biggener level
Joined: Jan 09, 2001
Aug 21, 2001 06:25:00
DecimalFormat df = new DecimalFormat( "#.00" ); System.out.println( df.format( 567.236587 ) );
Joined: Jul 27, 2001
Aug 21, 2001 07:40:00
If you want a number and not a
, you can do it simply enough with the following code:
float unrounded = 567.2365874589f;
float rounded = Math.round(unrounded * 100) / 100.0f;
I agree. Here's the link:
subject: stop the double type value up to 2 or 3 decimal
Why is "float f4 = 42e7" not considered a valid declaration of a float in Java?
WA #2 ..... word association
Anyone finish this in a month!!!???
Most addictive song ever.
Values for weightx and weighty
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015