0.0
No commit activity in last 3 years
No release in over 3 years
Tries to parse various crazy money formats
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme
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.