Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@coingecko/cryptoformat

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coingecko/cryptoformat - npm Package Compare versions

Comparing version
0.8.0
to
0.8.1
+2
-2
lib/cryptoformat.cjs.js

@@ -81,7 +81,7 @@ 'use strict';

function decimalTrailingZeroesToExponent(formattedCurrency, maximumDecimalTrailingZeroes) {
const decimalTrailingZeroesPattern = new RegExp(`\\.(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
const decimalTrailingZeroesPattern = new RegExp(`(\\.|,)(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
return formattedCurrency.replace(
decimalTrailingZeroesPattern,
(match, decimalTrailingZeroes) => `.0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
(_match, separator, decimalTrailingZeroes) => `${separator}0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
)

@@ -88,0 +88,0 @@ }

@@ -77,7 +77,7 @@ // A map of supported currency codes to currency symbols.

function decimalTrailingZeroesToExponent(formattedCurrency, maximumDecimalTrailingZeroes) {
const decimalTrailingZeroesPattern = new RegExp(`\\.(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
const decimalTrailingZeroesPattern = new RegExp(`(\\.|,)(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
return formattedCurrency.replace(
decimalTrailingZeroesPattern,
(match, decimalTrailingZeroes) => `.0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
(_match, separator, decimalTrailingZeroes) => `${separator}0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
)

@@ -84,0 +84,0 @@ }

@@ -83,7 +83,7 @@ (function (global, factory) {

function decimalTrailingZeroesToExponent(formattedCurrency, maximumDecimalTrailingZeroes) {
const decimalTrailingZeroesPattern = new RegExp(`\\.(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
const decimalTrailingZeroesPattern = new RegExp(`(\\.|,)(0{${maximumDecimalTrailingZeroes + 1},})(?=[1-9]?)`);
return formattedCurrency.replace(
decimalTrailingZeroesPattern,
(match, decimalTrailingZeroes) => `.0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
(_match, separator, decimalTrailingZeroes) => `${separator}0<sub title=\"${formattedCurrency}\">${decimalTrailingZeroes.length}</sub>`,
)

@@ -90,0 +90,0 @@ }

{
"name": "@coingecko/cryptoformat",
"version": "0.8.0",
"version": "0.8.1",
"description": "Javascript library to format and display cryptocurrencies and fiat",

@@ -5,0 +5,0 @@ "main": "lib/cryptoformat.cjs.js",