fix: product decimal

This commit is contained in:
puriphatt 2024-09-26 13:36:39 +07:00
parent ef49f374cd
commit 401dbab1ca
2 changed files with 45 additions and 7 deletions

View file

@ -416,7 +416,8 @@ export async function waitAll<T extends Promise<any>[]>(arr: T) {
}
export function commaInput(text: string): string {
if (typeof text !== 'string') return '';
if (typeof text !== 'string') return '0';
if (!text) return '0';
const num = text.replace(/,/gi, '');
const numF = num.split(/(?=(?:\d{3})+$)/).join(',');