Hi there,
I have been facing problem in displaying the value of the column which is of type float. by default it displays only single digit after decimal point so how can I set the precision while displaying the value of the field in the rhtml file
thanking you
On May 21, 2007, at 7:58 AM, ruby wrote:
You need to format it yourself as in:
<%= ‘%.2f’ % [your_value] %>
Compare:
‘%.2f’ % [4.5] => “4.50” 4.5.to_s => “4.5”
-Rob
Rob B. http://agileconsultingllc.com [email protected]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.