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
fractional =.25
whole = 3
How can we do this in Java?
double value = 3.25; double fractionalPart = value % 1; double integralPart = value - fractionalPart;
2.1m questions
2.1m answers
60 comments
57.0k users