Git Product home page Git Product logo

money-heuristics's Introduction

RubyMoney - Money Heuristics

This is a module for heuristic analysis of the string input for the money gem. It was formerly part of the gem.

Gem Version Build Status License

Installation

Include this line in your Gemfile:

gem 'money-heuristics'

Usage

>> Money::Currency.analyze 'USD 200'
=> ["USD"]
>> Money::Currency.analyze 'zł123,000.50'
=> ["PLN"]

Contributing

See the Contribution Guidelines

money-heuristics's People

Contributors

antstorm avatar berkos avatar doutatsu avatar semmons99 avatar stereobooster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

money-heuristics's Issues

Ability to ignore some checks

It would be great if we could pass into analyze specific checks that I am interested in, say only find by iso_codes, so Money::Currency.analyze(str, :iso_codes) or similar.

My project has the ability to set have free text input and I was analyzing on my end just using iso_codes from Money::Currency.all.map(&iso_codes), but this gem would be much better than my bad Regex. Problem is, for say d + 1, I don't want to get the currency as it can be user defined variable. So just having ability to check for iso_codes, so I don't need to manually test 12USD + 2. Anyways thought I'd drop these thoughts in here and maybe I'll be able to set up the fork and do this myself.

P.S. I wanted to contribute this change as it seems to be pretty straightforward, but being new to open source contribution couldn't get the tests to run due to it asking to add gem to the gemfile as I perhaps Bundler is using the install money, so I didn't manage to get the fork working

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.