18 lines
407 B
TypeScript
18 lines
407 B
TypeScript
export function formatCurrency(value: number) {
|
|
return new Intl.NumberFormat('th-TH', {
|
|
style: 'currency',
|
|
currency: 'THB',
|
|
maximumFractionDigits: 0
|
|
}).format(value);
|
|
}
|
|
|
|
import { formatDate as formatGlobalDate } from '@/lib/date-format';
|
|
|
|
export function formatDate(value: string) {
|
|
return formatGlobalDate(value);
|
|
}
|
|
|
|
export function formatPercent(value: number) {
|
|
return `${value}%`;
|
|
}
|