Skip to content

leikind/money_parser

Repository files navigation

Author

Yuri Leikind

A simple function in Ruby and a similar function in Javascript which try to parse a string containing a money amount in any format and return a float for javascript and a BigDecimal for Ruby.

The functions return nil/null if the input is not a a money amount.

specification.rb contains input/output pairs.

The tests are generated by rake generate_tests from specification.rb.

To install add

gem "money_parser"

or

gem "money_parser", :git => 'git://github.com/leikind/money_parser.git'

to your Gemfile, and

//= require parse_money

to your app/assets/javascripts/application.js, and run bundle install.

After that you can call JS function parseMoney() on the client side, and Ruby function MoneyParser.parse on the server side.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published