b2m-utils 0.0.132 → 0.0.134

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.
@@ -0,0 +1 @@
1
+ export declare const convertNumberToCurrency: (value: number, locale?: string) => string;
@@ -1,3 +1,4 @@
1
+ export * from './convertNumberToCurrency';
1
2
  export * from './getNormalizedCityName';
2
3
  export * from './getContractFromFreight';
3
4
  export * from './getContractRouteFromFreight';
@@ -1,3 +1,21 @@
1
+ var convertNumberToCurrency = function (value, locale) {
2
+ if (locale === void 0) { locale = 'en-US'; }
3
+ var configObject = {
4
+ locale: 'en-US',
5
+ currency: 'USD',
6
+ };
7
+ switch (locale) {
8
+ case 'pt-br':
9
+ configObject.locale = 'pt-br';
10
+ configObject.currency = 'BRL';
11
+ break;
12
+ }
13
+ return (+value).toLocaleString(configObject.locale, {
14
+ style: 'currency',
15
+ currency: configObject.currency,
16
+ });
17
+ };
18
+
1
19
  var getNormalizedCityName = function (name) {
2
20
  return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
3
21
  };
@@ -6462,5 +6480,5 @@ var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void
6462
6480
  });
6463
6481
  }); };
6464
6482
 
6465
- export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DocumentTypeEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, FreightRegionEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SlaRegionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, formatDateString, getConfigurationFromDomain, getContractFromFreight, getContractRouteFromFreight, getCookies, getDataFromToken, getFormattedFreightPlaceName, getNormalizedCityName, getRouteDeliveryTimeFromFreight, getRouteOnTimeFromFreight, setFormattedDatesInObjects };
6483
+ export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DocumentTypeEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, FreightRegionEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SlaRegionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, convertNumberToCurrency, formatDateString, getConfigurationFromDomain, getContractFromFreight, getContractRouteFromFreight, getCookies, getDataFromToken, getFormattedFreightPlaceName, getNormalizedCityName, getRouteDeliveryTimeFromFreight, getRouteOnTimeFromFreight, setFormattedDatesInObjects };
6466
6484
  //# sourceMappingURL=index.esm.js.map
Binary file