String abc=11235.271;
Float.parsefloat(abc);
o/p 11235.271 no data loss
while as in
String abc=58996.706;
Float.parsefloat(abc);
o/p 58996.707
.001 is getting added after decimal
Can anyone pls help me on this
String abc=11235.271;
Float.parsefloat(abc);
o/p 11235.271 no data loss
while as in
String abc=58996.706;
Float.parsefloat(abc);
o/p 58996.707
.001 is getting added after decimal
Can anyone pls help me on this
consider using a double or bigDecimal:
String abc2 = "58996.706";
System.out.println(Double.parseDouble(abc2));
System.out.println(new BigDecimal(abc2));