| Author |
Rounding of float value
|
AnilPrakash Raju
Ranch Hand
Joined: Jul 26, 2004
Posts: 137
|
|
Hi, how can i rouud off a float value eg. 7.39999 to 7.4 thanks Anil
|
 |
Ariel Ortiz
Ranch Hand
Joined: May 14, 2004
Posts: 121
|
|
Try the Math.round() method. ...Ariel
|
 |
AnilPrakash Raju
Ranch Hand
Joined: Jul 26, 2004
Posts: 137
|
|
Thanks Ariel but Math.round() returns an int. is there any function that i can use to specify how many decimal points i want? thanks Anil
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Try java.text.DecimalFormat [ July 21, 2005: Message edited by: Mani Ram ]
|
Mani
Quaerendo Invenietis
|
 |
AnilPrakash Raju
Ranch Hand
Joined: Jul 26, 2004
Posts: 137
|
|
Thanks Mani Anil
|
 |
satishkumar janakiraman
Ranch Hand
Joined: May 03, 2004
Posts: 334
|
|
Hi Try this code for rounding off your float value bye for now sat
|
 |
 |
|
|
subject: Rounding of float value
|
|
|