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

Change USDC decimal places from 2 to 6 #1089

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog

## Upcoming
## Upcoming 7.0.0.alpha

-
- **Potential breaking change**: Fix USDC decimals places from 2 to 6

## 6.19.0

Expand Down
2 changes: 1 addition & 1 deletion config/currency_non_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"disambiguate_symbol": "USDC",
"alternate_symbols": [],
"subunit": "Cent",
"subunit_to_unit": 100,
"subunit_to_unit": 1000000,
"symbol_first": false,
"html_entity": "$",
"decimal_mark": ".",
Expand Down
10 changes: 5 additions & 5 deletions spec/money/formatting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@
expect(Money.new(1999_98, "NOK").format).to eq("1.999,98 kr")
expect(Money.new(1999_98, "SEK").format).to eq("1 999,98 kr")
expect(Money.new(1999_98, "BCH").format).to eq("0.00199998 ₿")
expect(Money.new(1999_98, "USDC").format).to eq("1,999.98 USDC")
expect(Money.new(1999_98, "USDC").format).to eq("0.199998 USDC")
end

it "returns ambiguous signs when disambiguate is false" do
Expand All @@ -868,7 +868,7 @@
expect(Money.new(1999_98, "NOK").format(disambiguate: false)).to eq("1.999,98 kr")
expect(Money.new(1999_98, "SEK").format(disambiguate: false)).to eq("1 999,98 kr")
expect(Money.new(1999_98, "BCH").format(disambiguate: false)).to eq("0.00199998 ₿")
expect(Money.new(1999_98, "USDC").format(disambiguate: false)).to eq("1,999.98 USDC")
expect(Money.new(1999_98, "USDC").format(disambiguate: false)).to eq("0.199998 USDC")
end

it "returns disambiguate signs when disambiguate: true" do
Expand All @@ -878,7 +878,7 @@
expect(Money.new(1999_98, "NOK").format(disambiguate: true)).to eq("1.999,98 NOK")
expect(Money.new(1999_98, "SEK").format(disambiguate: true)).to eq("1 999,98 SEK")
expect(Money.new(1999_98, "BCH").format(disambiguate: true)).to eq("0.00199998 ₿CH")
expect(Money.new(1999_98, "USDC").format(disambiguate: true)).to eq("1,999.98 USDC")
expect(Money.new(1999_98, "USDC").format(disambiguate: true)).to eq("0.199998 USDC")
end

it "returns disambiguate signs when disambiguate: true and symbol: true" do
Expand All @@ -888,7 +888,7 @@
expect(Money.new(1999_98, "NOK").format(disambiguate: true, symbol: true)).to eq("1.999,98 NOK")
expect(Money.new(1999_98, "SEK").format(disambiguate: true, symbol: true)).to eq("1 999,98 SEK")
expect(Money.new(1999_98, "BCH").format(disambiguate: true, symbol: true)).to eq("0.00199998 ₿CH")
expect(Money.new(1999_98, "USDC").format(disambiguate: true, symbol: true)).to eq("1,999.98 USDC")
expect(Money.new(1999_98, "USDC").format(disambiguate: true, symbol: true)).to eq("0.199998 USDC")
end

it "returns no signs when disambiguate: true and symbol: false" do
Expand All @@ -898,7 +898,7 @@
expect(Money.new(1999_98, "NOK").format(disambiguate: true, symbol: false)).to eq("1.999,98")
expect(Money.new(1999_98, "SEK").format(disambiguate: true, symbol: false)).to eq("1 999,98")
expect(Money.new(1999_98, "BCH").format(disambiguate: true, symbol: false)).to eq("0.00199998")
expect(Money.new(1999_98, "USDC").format(disambiguate: true, symbol: false)).to eq("1,999.98")
expect(Money.new(1999_98, "USDC").format(disambiguate: true, symbol: false)).to eq("0.199998")
end

it "should never return an ambiguous format with disambiguate: true" do
Expand Down