Skip to content

Instantly share code, notes, and snippets.

@michaelklishin
Forked from mattetti/gist:11564
Created September 19, 2008 07:00
Show Gist options
  • Save michaelklishin/11566 to your computer and use it in GitHub Desktop.
Save michaelklishin/11566 to your computer and use it in GitHub Desktop.
it "should be able to add a format" do
ru_format = {:ru =>
{ :number => {
:precision => 2,
:delimiter => ' ',
:separator => ','
},
:currency => {
:unit => 'р.',
:format => '%n %u',
:precision => 2
}
}
}
Numeric::Transformer.add_format(ru_format)
Numeric::Transformer.change_default_format(:ru)
12345.to_currency.should == "12 345,00 рублей"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment