
Help about function ROUND.
Hi Jose
For my needs I've made a function for that.
FUNCTION FcRound(nBetr,fk)
// usual fk = 5 if rounding to 0.5, 2 if rounding to 0.2 etc.
LOCAL n
IF nBetr <> 0
n := Int(Abs(nBetr)*100/fk+0.5)/(100/fk)
IF nBetr < 0 ; nBetr := -n
ELSE ; nBetr := n
ENDIF
ENDIF
RETURN nBetr
Function call:
nAmount := FcRound(nAmount,5)
HTH
Walt
Quote:
> My problem is...
> Round(97.45 * 10 / 100, 2) = 9.74
> when it should be 9.75.
> Someone Can help me ?
> Thanks.