Hi,
Instead of fix function, you can use a rounding function, there're many around here, you can see
this thread.
Here's mine (last release)
(defun round (num prec)
(if (zerop (setq prec (abs prec)))
num
(if (minusp num)
(* prec (fix (- (/ num prec) 0.5)))
(* prec (fix (+ (/ num prec) 0.5)))
)
)
)
Using:
(round pi 0.01) -> 3.14
(round pi 1e-5) -> 3.14159
(round 5456.50 1) -> 5457
(round 5456.50 100.0) -> 5500.0
Note that if prec argument is an interger, the result will be an integer too.