answer1 = INT(answer)
26 = INT(26.4)
-2 = INT(-1.1) (NOTE: The Integer function rounds down to the previous integer, since -1.1 is greater than -2, the answer is -2, not -1, since -1 is greater than -1.1.)
answer1 = FRAC(answer)
FRAC(2.6) = .6
FRAC(-2.6) = -.6
For those who don't have a FRAC() function, here's how to get the decimal portion of the answer. You lose the sign so you end up with a decimal part of the answer.
answer1 = ABS(answer) - INT(ABS(answer))
ABS(2.6) - INT(ABS(2.6)) = .6 (2.6 - 2)
ABS(-2.6) - INT(ABS(-2.6)) = .6 (2.6 - 2)
To get the positive offset of the decimal portion of the previous integer, use this formula:
answer1 = answer - INT(answer)
2.6 - INT(2.6) = .6 (2.6 - 2)
-2.6 - INT(-2.6) = .4 (-2.6 + 3)
© 1995-2023. davesfunstuff.com. All Rights Reserved. Reproduction of any part of this website without expressed written consent is prohibited.