Viable NumberFormat solution in JAVA?
Posted on 2005-04-24
I'm very new to Java so bear with me please. I wrote a little script to find out ones weight on the moon and it works to a certain degree. I'd rather get rid of the trailing notation at the end though. Say I insert 61lbs, it outputs 10.126000000000001. How could I about just displaying the set of numers, not the stuff after the decimal point? I do know in php i'd use something like printf to get the job done. I guess I must also say, that it should roundup somehow, if that is possible :)
Thanks in advance!