dcsimg
Rounding off in float??
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   OBUCHI_MACHINI
Posted On:   Thursday, May 2, 2002 08:04 AM

I have a float which I get by division and I have to restrict the decimal places to two.. can anybody suggest me how to do this ???

Re: Rounding off in float??

Posted By:   brett_haas  
Posted On:   Thursday, May 2, 2002 08:18 AM


DecimalFormat df = new DecimalFormat(".00");

NumberFormat formater = NumberFormat.getCurrencyInstance();

formater.format(yourFloat)
About | Sitemap | Contact