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
“%.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