radar / humanize

Takes your numbers and makes them *fancy*.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decimals not being humanized for BigDecimal numbers

skuark opened this issue · comments

It seems there is a problem generating the humanized version of BigDecimal decimal part.

-> % irb
irb(main):001:0> require 'humanize'
=> true
irb(main):002:0> 123.45.humanize
=> "one hundred and twenty-three point four five"
irb(main):003:0> BigDecimal.new("123.45")
=> 0.12345e3
irb(main):004:0> BigDecimal.new("123.45").humanize
=> "one hundred and twenty-three"

I haven't checked it yet. But, if you know how to fix it, pull request is very much appreciated.

@skuark FYI, I was the one who added BigDecimal.

Thanks styd. Nope, for now I've couldn't take an eye to the code to understand where is the problem. But I'll try to check it.

You're welcome, @skuark. Thanks for reporting the issue.