diff --git a/package.json b/package.json index 55b47fa..6469cfc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@platformbuilders/helpers", - "version": "0.5.2", + "version": "0.5.3", "description": "Builders helpers library", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/shared/currencyParser.ts b/src/shared/currencyParser.ts index f8e7c76..fad7d4a 100644 --- a/src/shared/currencyParser.ts +++ b/src/shared/currencyParser.ts @@ -4,6 +4,7 @@ const NUMBER_OF_DECIMAL_PLACES_DEFAULT = 2; export const currencyParser = ( value: string | number, numberOfDecimalPlaces = NUMBER_OF_DECIMAL_PLACES_DEFAULT, + currency = 'R$', ): string => { let formatValue = value; const isValidValue = regex.test(String(value)); @@ -21,5 +22,5 @@ export const currencyParser = ( .replace('.', ',') .replace(/(\d)(?=(\d{3})+,)/g, '$1.'); - return `R$ ${withDecimalValue}`; + return `${currency} ${withDecimalValue}`; }; diff --git a/yarn.lock b/yarn.lock index 4b607ee..7d18073 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5670,7 +5670,7 @@ metro-react-native-babel-preset@0.72.3: "@babel/template" "^7.0.0" react-refresh "^0.4.0" -metro-react-native-babel-preset@^0.73.3: +metro-react-native-babel-preset@0.73.3: version "0.73.3" resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.73.3.tgz#c4a0fcae395894ec85e235ec75de88d56f64e291" integrity sha512-JJ22lR4CVaw3OKTz9YAY/ckymr3DbO+qy/x5kLaF4g0LcvZmhhKfDK+fml577AZU6sKb/CTd0SBwt+VAz+Hu7Q==