| Author |
restrict the decimal value
|
saikrishna cinux
Ranch Hand
Joined: Apr 16, 2005
Posts: 689
|
|
i am displaying the result in decimal value.for that i wanna display only 2 numbers after the decimal how can i do that.. thanx in advance. cinux
|
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24059
|
|
|
Look at the java.text.DecimalFormat class.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Sivaraman Lakshmanan
Ranch Hand
Joined: Aug 02, 2003
Posts: 231
|
|
Hi, If you just want to show 2 digits after decimal, use java.text.DecimalFormat. Regards, Sivaraman.L
|
 |
 |
|
|
subject: restrict the decimal value
|
|
|