On Thu, Dec 25, 2008 at 10:06 AM, Matt Harrison <[email protected]> wrote:
> I am dealing with money, and I do know there are problems with > calculations and float accuracy. I have taken a quick look at the money > gem and BigDecimal, but I don't see how they will do the job I want. ?? Not sure what that means, but there's no question you should use BigDecimal to represent a decimal value like money. Or to put it another way, there's no conceptual reason to use a Float for this. :-) > I've done some testing and the error doesn't appear when just outputting > the value in a view. I'm using the BarGraph helper[1], and it's only > when I'm setting the values for the graph that I get the error. Ah, OK. That helper is apparently using the supplied input values as numbers to generate the graph. Trying to turn a value into a String at that point is definitely going to cause the failure you're seeing. If you want a decimal number like "100.00" to /display/ in the view, I think you'll need to change the helper. Bummer that there don't seem to be any tests for it. HTH, and good luck! -- Hassan Schroeder ------------------------ [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

