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

Already on GitHub? Sign in to your account

Add support for Japanese Yen #101

Merged
merged 3 commits into from Aug 1, 2011

Conversation

Projects
None yet
7 participants
Contributor

pwim commented Aug 1, 2011

As mentioned in Issue #99, Japanese yen does not have a minor unit. Additionally, when displaying Japanese Yen in Japanese, you normally use the Kanji "円" for Yen, without a space between the number and symbol (for example, 300円). This pull request fixes these issues.

semmons99 added a commit that referenced this pull request Aug 1, 2011

Merge pull request #101 from pwim/master
Add support for Japanese Yen

@semmons99 semmons99 merged commit ed7707e into RubyMoney:master Aug 1, 2011

Owner

semmons99 commented Aug 1, 2011

Thanks for the patch!

Contributor

hakanensari commented on 4e3fb3d Aug 11, 2011

Good to see you guys finally changed your minds on this!

alto replied Sep 14, 2011

I don't get it. Why is

 one["JPY"] == "¥100"

and not

one["JPY"] == "¥1"

?

alto replied Sep 14, 2011

And the same with this: shouldn't it be

one_thousand["JPY"].should == "¥1,000"

?

alto replied Sep 14, 2011

Ah, now I see, it's all about the Proc used to produce the 'one' and the one_thousand. Everything's fine :-)

Contributor

slbug replied Nov 2, 2011

Why so?

Subunit
1/100 sen
1/1000 rin

It's not used, but exists. Same thing as BYR, there is no cents (10 Br min), but it exists in money gem

And hot to deal with float exchange rates? e.g. 1 USD = 78.04 JPY, not 78

Contributor

pwim replied Nov 3, 2011

ISO 4217 doesn't list a minor unit. Because it existed at one point in time isn't a good argument to use it. For instance, the US once used the half-cent, but money doesn't support that unit.

As for exchange rates, money already doesn't deal with fractional units. For example, 1 JPY = 0.012811 USD, not 0.01 USD.

gtd replied May 25, 2014

Ugh, just got burned bad by this. Upgraded the Money gem and our subscribers paying ¥500 were just charge ¥50,000. I guess the lesson is have test coverage for every currency and don't assume they all work the same. Fuckity fuck fuck fuck.

thijsc commented on 4e3fb3d Aug 30, 2012

I'm really confused about this. Shouldn't the the result on line 264 be "¥1"?

Contributor

pwim commented Aug 31, 2012

@thijsc The spec is assuming the currency has 100 subunits to a unit (like 100 cents in a dollar), whereas the yen has no subunit,

thijsc commented Aug 31, 2012

Thanks for the info. This is a bit of a confusing subject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment