Skip to content

Commit

Permalink
adjusts dp from 8 to 12, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
wongy91 committed Jun 10, 2021
1 parent 6901db3 commit 6f5552a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/cryptoformat.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function initializeFormatters(isoCode, locale) {
: generateFormatter(isoCode, locale, 6);
currencyFormatterVerySmall = cachedFormatter
? cachedFormatter.currencyFormatterVerySmall
: generateFormatter(isoCode, locale, 8);
: generateFormatter(isoCode, locale, 12);

// Save in cache
if (cachedFormatter == null) {
Expand Down Expand Up @@ -311,7 +311,7 @@ function formatCurrency(
if (amount === 0.0) {
return price.toFixed(2);
}
return price.toPrecision(8);
return price.toPrecision(12);
}

if (amount === 0.0) {
Expand Down Expand Up @@ -341,7 +341,7 @@ function formatCurrency(
locale
);
} else {
// Crypto amount < 1, show 8 fraction digits
// Crypto amount < 1, show 12 fraction digits
return formatCurrencyOverride(
currencyFormatterVerySmall.format(amount),
locale
Expand Down
6 changes: 3 additions & 3 deletions lib/cryptoformat.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function initializeFormatters(isoCode, locale) {
: generateFormatter(isoCode, locale, 6);
currencyFormatterVerySmall = cachedFormatter
? cachedFormatter.currencyFormatterVerySmall
: generateFormatter(isoCode, locale, 8);
: generateFormatter(isoCode, locale, 12);

// Save in cache
if (cachedFormatter == null) {
Expand Down Expand Up @@ -307,7 +307,7 @@ function formatCurrency(
if (amount === 0.0) {
return price.toFixed(2);
}
return price.toPrecision(8);
return price.toPrecision(12);
}

if (amount === 0.0) {
Expand Down Expand Up @@ -337,7 +337,7 @@ function formatCurrency(
locale
);
} else {
// Crypto amount < 1, show 8 fraction digits
// Crypto amount < 1, show 12 fraction digits
return formatCurrencyOverride(
currencyFormatterVerySmall.format(amount),
locale
Expand Down
6 changes: 3 additions & 3 deletions lib/cryptoformat.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
: generateFormatter(isoCode, locale, 6);
currencyFormatterVerySmall = cachedFormatter
? cachedFormatter.currencyFormatterVerySmall
: generateFormatter(isoCode, locale, 8);
: generateFormatter(isoCode, locale, 12);

// Save in cache
if (cachedFormatter == null) {
Expand Down Expand Up @@ -313,7 +313,7 @@
if (amount === 0.0) {
return price.toFixed(2);
}
return price.toPrecision(8);
return price.toPrecision(12);
}

if (amount === 0.0) {
Expand Down Expand Up @@ -343,7 +343,7 @@
locale
);
} else {
// Crypto amount < 1, show 8 fraction digits
// Crypto amount < 1, show 12 fraction digits
return formatCurrencyOverride(
currencyFormatterVerySmall.format(amount),
locale
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coingecko/cryptoformat",
"version": "0.4.2",
"version": "0.4.3",
"description": "Javascript library to format and display cryptocurrencies and fiat",
"main": "lib/cryptoformat.cjs.js",
"module": "lib/cryptoformat.esm.js",
Expand Down

0 comments on commit 6f5552a

Please sign in to comment.