task-b
task-b.1 complere
This commit is contained in:
19
src/features/crm-demo/utils/format.ts
Normal file
19
src/features/crm-demo/utils/format.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export function formatCurrency(value: number) {
|
||||
return new Intl.NumberFormat('th-TH', {
|
||||
style: 'currency',
|
||||
currency: 'THB',
|
||||
maximumFractionDigits: 0
|
||||
}).format(value);
|
||||
}
|
||||
|
||||
export function formatDate(value: string) {
|
||||
return new Intl.DateTimeFormat('th-TH', {
|
||||
day: '2-digit',
|
||||
month: 'short',
|
||||
year: 'numeric'
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
export function formatPercent(value: number) {
|
||||
return `${value}%`;
|
||||
}
|
||||
Reference in New Issue
Block a user