Outputting Currency Value from MySQL
I've created a Rails app for our intranet - a simple client tracking tool. One of the client fields I have is the monthly fee they pay for our services. In MySQL, I have this stored as a decimal type (5,2). However, when I output this in my .rhtml template, it only shows the first place after the decimal.
<td>Monthly Bill</td><td>$<%= client.bill %></td>
It is showing as "30.0" instead of "30.00".
I checked the Ruby references but couldn't find a method to output a fload to a certain precision. Any ideas?