diff --git a/src/utils/formatter.js b/src/utils/formatter.js new file mode 100644 index 000000000..2d5c6225f --- /dev/null +++ b/src/utils/formatter.js @@ -0,0 +1,24 @@ +// utils/formatter.js + +// Data formatting utility +class Formatter { + static formatCurrency(amount, currency = 'USD') { + return new Intl.NumberFormat('en-US', { + style: 'currency', + currency: currency, + }).format(amount); + } + + static formatDate(date) { + return new Intl.DateTimeFormat('en-US').format(new Date(date)); + } + + static formatResponse(data) { + return { + success: true, + data: data, + }; + } +} + +module.exports = Formatter;