How do I get whole and fractional parts from double in JSP/Java ? If the value is 3.25 then I want to get fractional =.25
, whole = 3
How can we do this in Java?
double value = 3.25;
double fractionalPart = value % 1;
double integralPart = value - fractionalPart;