Skip to content

Instantly share code, notes, and snippets.

@mattetti
Created September 19, 2008 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattetti/11564 to your computer and use it in GitHub Desktop.
Save mattetti/11564 to your computer and use it in GitHub Desktop.
it "should be able to add a format" do
merb_format = {:merb =>
{ :number => {
:precision => 3,
:delimiter => ' ',
:separator => ','
},
:currency => {
:unit => 'Merbollars',
:format => '%n %u',
:precision => 2
}
}
}
Numeric::Transformer.add_format(merb_format)
Numeric::Transformer.change_default_format(:merb)
12345.to_currency.should == "12 345,00 Merbollars"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment