| || |
Subtraction without rounding off
Can anyone give me a function that subtracts two real numbers and gives an answer with the first 2 decimal places without rounding off.
That is, say, an answer after subtarcting 2 numbers is 45.096, I want the answer as 45.09 and not as 45.10 as SilKtest would normally return.
Re: Subtraction without rounding off
Can you use string instead?
[ ] int iLen, iPos
[ ] float fNum
[ ] float i = 45.096
[ ] string sString, sSubString
[ ] sString = [string]i
[ ] iLen = Len(sString)
[ ] iPos = StrPos (".",sString)
[ ] sSubString = Left (sString, iPos+2)
[ ] print (sSubString)