kupos-ui-components-lib 10.4.56 → 10.4.57
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.
|
@@ -470,11 +470,12 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
|
|
|
470
470
|
justifyContent: "flex-end",
|
|
471
471
|
} },
|
|
472
472
|
currency ? currency : "",
|
|
473
|
+
" ",
|
|
473
474
|
CommonService.currencyExact(isPeru
|
|
474
475
|
? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
|
|
475
476
|
100
|
|
476
477
|
: removeDiscountAtomValue
|
|
477
478
|
? 0
|
|
478
|
-
: netFare)))))));
|
|
479
|
+
: netFare, currencySign)))))));
|
|
479
480
|
};
|
|
480
481
|
export default PaymentSideBarDesktop;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const commonService: {
|
|
2
2
|
currency(amount: number, currencySign?: string): string;
|
|
3
|
-
currencyExact: (amount:
|
|
3
|
+
currencyExact: (amount: number, currencySign?: string) => string;
|
|
4
4
|
currencyFixed(amount: number, currencySign?: string, decimals?: number): string;
|
|
5
5
|
currencyRounded(amount: number, currencySign?: string): string;
|
|
6
6
|
discountedCurrency(amount: number, currencySign?: string): string;
|
|
@@ -13,13 +13,14 @@ const commonService = {
|
|
|
13
13
|
const sign = currencySign || "$";
|
|
14
14
|
return sign + formattedAmount;
|
|
15
15
|
},
|
|
16
|
-
currencyExact: (amount) => {
|
|
16
|
+
currencyExact: (amount, currencySign) => {
|
|
17
|
+
const sign = currencySign || "$";
|
|
17
18
|
if (amount === null || amount === undefined || isNaN(amount))
|
|
18
|
-
return "
|
|
19
|
+
return sign + "0";
|
|
19
20
|
const rounded = Math.round(+amount * 100) / 100;
|
|
20
21
|
const parts = String(rounded).split(".");
|
|
21
22
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
22
|
-
return
|
|
23
|
+
return sign + parts.join(".");
|
|
23
24
|
},
|
|
24
25
|
currencyFixed(amount, currencySign, decimals = 2) {
|
|
25
26
|
const formattedAmount = fixFloatPrecision(amount, decimals)
|
package/package.json
CHANGED
|
@@ -914,8 +914,7 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
914
914
|
justifyContent: "flex-end",
|
|
915
915
|
}}
|
|
916
916
|
>
|
|
917
|
-
{currency ? currency : ""}
|
|
918
|
-
|
|
917
|
+
{currency ? currency : ""}{" "}
|
|
919
918
|
{CommonService.currencyExact(
|
|
920
919
|
isPeru
|
|
921
920
|
? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
|
|
@@ -923,6 +922,7 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
923
922
|
: removeDiscountAtomValue
|
|
924
923
|
? 0
|
|
925
924
|
: netFare,
|
|
925
|
+
currencySign,
|
|
926
926
|
)}
|
|
927
927
|
</div>
|
|
928
928
|
</div>
|
|
@@ -16,12 +16,13 @@ const commonService = {
|
|
|
16
16
|
return sign + formattedAmount;
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
currencyExact: (amount) => {
|
|
20
|
-
|
|
19
|
+
currencyExact: (amount: number, currencySign?: string) => {
|
|
20
|
+
const sign = currencySign || "$";
|
|
21
|
+
if (amount === null || amount === undefined || isNaN(amount)) return sign + "0";
|
|
21
22
|
const rounded = Math.round(+amount * 100) / 100;
|
|
22
23
|
const parts = String(rounded).split(".");
|
|
23
24
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
24
|
-
return
|
|
25
|
+
return sign + parts.join(".");
|
|
25
26
|
},
|
|
26
27
|
|
|
27
28
|
currencyFixed(amount: number, currencySign?: string, decimals: number = 2) {
|