b2m-utils 0.0.132 → 0.0.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/functions/convertNumberToCurrency/index.d.ts +1 -0
- package/build/functions/index.d.ts +1 -0
- package/build/index.esm.js +19 -1
- package/build/index.esm.js.gz +0 -0
- package/build/index.esm.js.map +1 -1
- package/build/index.js +19 -0
- package/build/index.js.gz +0 -0
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var convertNumberToCurrency = function (value, locale) {
|
|
6
|
+
if (locale === void 0) { locale = 'en-US'; }
|
|
7
|
+
var configObject = {
|
|
8
|
+
locale: 'en-US',
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
};
|
|
11
|
+
switch (locale) {
|
|
12
|
+
case 'pt-br':
|
|
13
|
+
configObject.locale = 'pt-br';
|
|
14
|
+
configObject.currency = 'BRL';
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
return (+value).toLocaleString(configObject.locale, {
|
|
18
|
+
style: 'currency',
|
|
19
|
+
currency: configObject.currency,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
5
23
|
var getNormalizedCityName = function (name) {
|
|
6
24
|
return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
7
25
|
};
|
|
@@ -6466,6 +6484,7 @@ var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void
|
|
|
6466
6484
|
});
|
|
6467
6485
|
}); };
|
|
6468
6486
|
|
|
6487
|
+
exports.convertNumberToCurrency = convertNumberToCurrency;
|
|
6469
6488
|
exports.formatDateString = formatDateString;
|
|
6470
6489
|
exports.getConfigurationFromDomain = getConfigurationFromDomain;
|
|
6471
6490
|
exports.getContractFromFreight = getContractFromFreight;
|
package/build/index.js.gz
CHANGED
|
Binary file
|