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

Updated the sources to allow for custom curreny #11

Merged
merged 2 commits into from Jun 26, 2013
Merged

Updated the sources to allow for custom curreny #11

merged 2 commits into from Jun 26, 2013

Conversation

ghost
Copy link

@ghost ghost commented Jun 24, 2013

This would solve issue #7 and seems to work fine.

If you have any feedback, I would love to hear it. Ruby is and have never been my primary language so maybe this could have been solved differently.

It still defaults to a prefixed $ for currency to avoid breaking backwards-compatibility, but then adds the ability to arbitrarily change the currency to allow for anything to be added. Including time, stocks, cows, you name it! :)

… command-line flags.

New command-line flags:
--currency (-c): Allows the user to set an arbitrary currency symbol.
--suffixed     : Tells reckon to use the currency as a suffix, e.g. 10 SEK, as opposed to a prefix like $10.
options[:currency] = '$'
end

unless options[:suffixed]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not needed since options[:suffixed] will be nil, which evaluates to false in any if statements.

@cantino
Copy link
Owner

cantino commented Jun 26, 2013

This looks like a great contribution, thank you @zebh! I've left a couple of comments.

@ghost
Copy link
Author

ghost commented Jun 26, 2013

Thanks for the comments. With the languages I'm used to, I would expect everything to go crazy for trying to treat a nil as a bool. Pays off to actually know the language tricks! :)

cantino added a commit that referenced this pull request Jun 26, 2013
Updated the sources to allow for custom curreny
@cantino cantino merged commit 5506b21 into cantino:master Jun 26, 2013
@cantino
Copy link
Owner

cantino commented Jun 26, 2013

Thanks @zebh!

@cantino cantino mentioned this pull request Jun 27, 2013
@ghost ghost deleted the currencies branch June 27, 2013 07:42
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.

1 participant