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

Currency without Cents #99

Closed
pwim opened this issue Jul 22, 2011 · 3 comments
Closed

Currency without Cents #99

pwim opened this issue Jul 22, 2011 · 3 comments

Comments

@pwim
Copy link
Contributor

pwim commented Jul 22, 2011

Currency such as Japanese Yen and Korean Won do not have cents. How should I fix this issue? For instance, should the following spec be corrected from:

# spec/money/formatting_spec.rb
one_thousand["JPY"].should == "¥1,000.00"

to

# spec/money/formatting_spec.rb
one_thousand["JPY"].should == "¥1,000"

or

# spec/money/formatting_spec.rb
one_thousand["JPY"].should == "¥100,000"
@semmons99
Copy link
Member

According to ISO, 1/100 of a Yen is a Sen, which is used by ISO as the cents notation for Yen. If you didn't want to use Sen, you could just call #format with :no_cents.

@pwim
Copy link
Contributor Author

pwim commented Jul 22, 2011

But there is no such thing as sen, as it was taken out of circulation in 1953. As I am living in Japan, I can assure you no one uses decimal units when using Yen.

I want to display currency how it would normally be displayed. For instance, with US Dollars, I want to display $100.00 and with yen ¥1,000. If I need to use :no_cents, then as far as I understand, I would need to inspect which currency I am displaying, defeating the point of using a library like this.

@semmons99 semmons99 reopened this Jul 22, 2011
@semmons99
Copy link
Member

If that's the case, I have no problem removing Sen. Please update the currency file appropriately and send a pull request. I'll merge it right away.

Losangelosgenetics pushed a commit to Losangelosgenetics/money that referenced this issue Mar 13, 2020
ArgumentError: can't omit precision for a Float.
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

No branches or pull requests

2 participants