I've got an application that is supposed to track takings of events for a charity I work with.
I totally overlooked the fact that the takings would be floats not integers and I'm now fixing that. Unfortunately I've run into a problem. I've already changed the columns in MySQL to floats, and I doubt this is the right way, but I've changed all my views, replacing @taking.total with "%.2f" % @taking.total Now the problem is that when the value of some departments are 0, I get the following error: comparison of String with 0 failed How should I be displaying these floats with the specified format? Is there a better way to do what I want? Grateful for any insights into this. Thanks and happy holidays Matt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

