From: Neil Stevens Date: 2005-12-13T10:38:10+09:00 Subject: Re: Using Float For Currency Hunter's Lists wrote: > Howdy, > > I have some methods that manipulate floats that represent a currency amount. > > I often end up with more precision than I need, i.e.: $9.756. > > What is the best way to scale that to 9.76? require 'bigdecimal' amount = BigDecimal.new('9.756') rounded = (amount * 100).round / 100 printf('%.02f', rounded) Outputs '9.76' -- Neil Stevens - neil@hakubi.us 'A republic, if you can keep it.' -- Benjamin Franklin