15 lines
366 B
TypeScript
15 lines
366 B
TypeScript
export const formatCurrency = (amount: number): string => {
|
|
return new Intl.NumberFormat('en-GB', {
|
|
style: 'currency',
|
|
currency: 'GBP'
|
|
}).format(amount);
|
|
};
|
|
|
|
export function formatGBP(value: number) {
|
|
return value.toLocaleString('en-GB', {
|
|
style: 'currency',
|
|
currency: 'GBP',
|
|
minimumFractionDigits: 2,
|
|
maximumFractionDigits: 2,
|
|
});
|
|
}
|