Originally posted by Ulf Dittmer:
Java has two classes for working with large integer and floating-point numbers. They're called java.math.BigInteger and java.math.BigDecimal, respectively.
Hi, thanks for the reply.
I've already tried using BigDecimal, but got problems with precision
this is the code :
double dAmnt = 154.20;
double amt = 1000000000;
BigDecimal bd1 = new BigDecimal(dAmnt);
BigDecimal bd2 = new BigDecimal(amt);
BigDecimal bd3 = bd1.multiply(bd2);
System.out.println("Bigdecimal == "+bd3);
I am getting the result as 154199999999.99998863131622783839702606201171875000000000