| Author |
Rounding Down To 2 Decimal Places
|
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
|
|
Hello; I have a double: 1.44565655755 I would like to round it up to: 1.45 Math.round turn it into a long. Is there not a round method somewhere that I can specify home many numbers after the decimal I would like? ie: Math.round(1.444455676767, 3) return 1.444 Thanks, Luke
|
Luke
SCJP
|
 |
Marilyn de Queiroz
Sheriff
Joined: Jul 22, 2000
Posts: 9033
|
|
|
Check out the NumberFormat class.
|
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
|
 |
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
|
|
|
thanks!
|
 |
 |
|
|
subject: Rounding Down To 2 Decimal Places
|
|
|