Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added to_cash methods to numerics and strings #1

Merged
merged 5 commits into from
Jun 6, 2013

Conversation

julescopeland
Copy link
Collaborator

Updated readme and changelog to explain in detail, but now, things like
123.45.to_cash
Will return a Cash object - in most cases just a simple Cash.new(number), but for strings it's a little bit cleverer:
'£12,345.67'.to_cash #=> Cash.new(12345.67)
It also passes all options straight through as well
12345.to_cash(foo: :bar) #=> Cash.new(12345, foo: :bar)

All code is tested and passing.

@semmons99
Copy link
Owner

@julescopeland thanks for the patch!

semmons99 added a commit that referenced this pull request Jun 6, 2013
Added to_cash methods to numerics and strings
@semmons99 semmons99 merged commit d2a0946 into semmons99:master Jun 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants