bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange bug


From: Mark H. Weaver
Subject: Re: Strange bug
Date: 22 Jan 2001 00:10:06 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.95

address@hidden (Hacksaw) writes:

> Allow me to change my "bug report" to a query: Is there a bignum
> package for emacs that supercedes all the regular operators so the if
> I add a bunch of prices, I don't get strange numbers?

Try using this function to round your results to the nearest cent:

(defun round-to-cent (value)
  (/ (fround (* value 100)) 100))

(round-to-cent (+ 20.00 9.99 9.99 18.00 11.99 9.99 9.99 3.25 3.00 9.99
                  18.00 9.99 11.50 9.99))
155.67

        Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]