Hi,
What do you guys use to definitely handle decimal numbers? This is
getting me crazy!
I use BigDecimal, but it craps out of the input number is something like
“14,53”, Rails transforms it as 14.0
Any solution?
Hi,
What do you guys use to definitely handle decimal numbers? This is
getting me crazy!
I use BigDecimal, but it craps out of the input number is something like
“14,53”, Rails transforms it as 14.0
Any solution?
What do you guys use to definitely handle decimal numbers? This is
getting me crazy!I use BigDecimal, but it craps out of the input number is something like
“14,53”, Rails transforms it as 14.0Any solution?
Are you really using the comma in the data?
This IRB session suggests what might be happening (unless there’s a en
ENV flag that allows the comma?):
require ‘bigdecimal’
=> truex = BigDecimal
=> BigDecimalx = 14.4564
=> 14.4564x = 14,4564
=> [14, 4564]
It seems Rails does it a bit differently. Anyway I was able to find a
solution:
–
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs