fix: comma function
This commit is contained in:
parent
133ede6a60
commit
3ae816c4c5
1 changed files with 8 additions and 0 deletions
|
|
@ -415,4 +415,12 @@ export async function waitAll<T extends Promise<any>[]>(arr: T) {
|
||||||
return await Promise.all(arr);
|
return await Promise.all(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function commaInput(text: string): string {
|
||||||
|
if (typeof text !== 'string') return '';
|
||||||
|
const num = text.replace(/,/gi, '');
|
||||||
|
const numF = num.split(/(?=(?:\d{3})+$)/).join(',');
|
||||||
|
|
||||||
|
return numF;
|
||||||
|
}
|
||||||
|
|
||||||
export default useUtilsStore;
|
export default useUtilsStore;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue