11 lines
314 B
TypeScript
11 lines
314 B
TypeScript
export const formatCurrency = (value: number | string) => {
|
|
return new Intl.NumberFormat('pt-BR', {
|
|
style: 'currency',
|
|
currency: 'BRL',
|
|
}).format(Number(value));
|
|
};
|
|
|
|
export const formatDate = (date: string | Date) => {
|
|
return new Intl.DateTimeFormat('pt-BR').format(new Date(date));
|
|
};
|