Quantcast
Channel: Notes posted by stevo
Viewing all articles
Browse latest Browse all 21

If you happen to face some weird rounding issue... (ActionView::Helpers::NumberHelper#number_to_currency)

$
0
0

i.e.

helper.number_to_currency(187)=>"190 kr"

check out your… translations! Especially ‘significant’ key… In my case it was

number:currency:format:significant:'false'

that broke rounding. It should have been

number:currency:format:significant:!'false'

And now it works perfectly

helper.number_to_currency(187)=>"187 kr"

Viewing all articles
Browse latest Browse all 21

Latest Images

Trending Articles





Latest Images