Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float number less than 1 is rounded to 1 #27

Open
koudelka001 opened this issue Oct 26, 2017 · 0 comments
Open

Float number less than 1 is rounded to 1 #27

koudelka001 opened this issue Oct 26, 2017 · 0 comments

Comments

@koudelka001
Copy link

koudelka001 commented Oct 26, 2017

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant