Wed Feb 13, 2008 9:53 pm
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
double num = 0.07568;
1- BigDecimal b = new BigDecimal(num).setScale(2,BigDecimal.ROUND_HALF_UP);
2- num=b.doubleValue();
System.out.println("Value is : "+ num);
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.