java decimal digits code example
Example 1: java double 2 decimal
String result = String.format("%.2f", value);
Example 2: how to check for a decimal point in java
d % 1 == 0
//THIS CHECKS IF VARIABLE D IS A WHOLE NUMBER
String result = String.format("%.2f", value);
d % 1 == 0
//THIS CHECKS IF VARIABLE D IS A WHOLE NUMBER