On Mon, Nov 30, 2009 at 12:22 AM, Joseph Smith <j...@uwcreations.com> wrote:

> What you want is to set the 'scale' of the BigDecimal.
>
> There doesn't seem to be a nice clojure macro for it, but this works:
>    user=> (.setScale (reduce + [15.00M 15.01M 3.00M 3.01M]) 3)
>    36.020M
>

That's what with-precision does, on a temporary basis. But for 36.02 to be
represented with-precision has to be at least 4 it seems. Looks like
with-precision is all the digits, scale is the ones right of the decimal
point.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to