java check decimal places code example
Example 1: how to check for a decimal point in java
d % 1 == 0
//THIS CHECKS IF VARIABLE D IS A WHOLE NUMBER
Example 2: java 2 decimals
double res = Math.round(a * 100) / 100;
d % 1 == 0
//THIS CHECKS IF VARIABLE D IS A WHOLE NUMBER
double res = Math.round(a * 100) / 100;