Files
cpost-mobile/src/helpers/formatPrice.ts
Samandar Turgunboyev c426b729b9 screen bug fix
2025-12-10 11:02:58 +05:00

9 lines
221 B
TypeScript

export const formatPrice = (amount: number | string) => {
const numericAmount = Number(amount) || 0;
const formatted = numericAmount
.toString()
.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
return formatted;
};