class test
{
public static void main(String[] args)
{
System.out.println( (1 - 0.85) );
}
}
Result is 0.15000000000000002.
Anyone know why?
Anyone know how I can fix this? I need 2-points after the decimal
place precision.
- Alan.
Original version, same result...
class test
{
public static void main(String[] args)
{
double price = 0.85;
double money = 1;
money = 1 - 0.85;
System.out.println(money);
}
}