to_xls
to_xls copied to clipboard
Float number less than 1 is rounded to 1
Checking the gem in a linux machine with thin server . Once I have got datas from a mysql query, when I want to send it to the to_xls gem, if with a attributes , one of the number is less than 1 (it is a float value in the model), inside of the excel, I get a 1 as value. But if the number is great than 1, this is not rounded, it doesn't matter if this attribute is define as string, the gem rounds the number too.
The number is correctly saved in datebase and in interfaz is perfectly shown the number value (float)
Code:
respond_to do |format| format.html format.xls { send_data @result.to_xls(:columns => [ :horas ],:headers => ['Horas']), :filename => 'datas.xls' } end
If I do same test in a environment in windows with both thin or webrick. The number is not rounded.
I do not know. If this mistake is produced to use this gem with linux.
Thanks you for all :)