|
@@ -67,9 +67,14 @@ export const isInStandaloneMode = () =>
|
|
|
document.referrer.includes("android-app://");
|
|
|
|
|
|
export const formatAmount = (amount?: string | number, fixed = 2) => {
|
|
|
- if (!amount) return new BigNumber(0).toFormat(fixed);
|
|
|
-
|
|
|
- return new BigNumber(amount).toFormat(fixed);
|
|
|
+ let toAmount: number | string = 0;
|
|
|
+ if (!!amount) {
|
|
|
+ toAmount = amount;
|
|
|
+ }
|
|
|
+ const base = new BigNumber(toAmount).toFormat(fixed);
|
|
|
+ let [integerPart, fractionalPart] = base.split(".");
|
|
|
+ integerPart = integerPart.replace(/\,/gi, ".");
|
|
|
+ return `${integerPart},${fractionalPart}`;
|
|
|
};
|
|
|
export const goBlankPage = async (handler: Function | string, target = "_self") => {
|
|
|
const isFunHanlder = typeof handler === "function";
|