Conversion to currency format

Hi,
Is there any handy (or standard) method to convert a Ruby string
"350000" or number 350000 to a US currency format such as: $350,000.00
or just $350,000 (without cents)? Thanks in advance.

···

--
Posted via http://www.ruby-forum.com/.

Jinho Lee wrote:

Hi,
Is there any handy (or standard) method to convert a Ruby string
"350000" or number 350000 to a US currency format such as: $350,000.00
or just $350,000 (without cents)? Thanks in advance.

http://currency.rubyforge.org/

Look at Currency::Parser, this seems like what you want.

···

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/

Rule of Open-Source Programming #20:

Open Code != Good Code

This is included in the ActionView library, that is also part of
Rails:

···

On Apr 5, 1:01 pm, Jinho Lee <jinh...@gmail.com> wrote:

Is there any handy (or standard) method to convert a Ruby string
"350000" or number 350000 to a US currency format such as: $350,000.00
or just $350,000 (without cents)? Thanks in advance.

Phillip Gawlowski wrote:

Look at Currency::Parser, this seems like what you want.

d'oh, Currency::Formatter is probably what you want, and not Currency::Parser.

···

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/

Rule of Open-Source Programming #4:

If you don't work on your project, chances are that no one will.