feat: Add default currency support and update currency handling in Revenue component

This commit is contained in:
Yash 2025-12-25 20:41:14 +05:30
parent 860e6390f1
commit 4eddac21c7
4 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,5 @@
import { DEFAULT_CURRENCY } from './constants';
export function parseTime(val: number) {
const days = ~~(val / 86400);
const hours = ~~(val / 3600) - days * 24;
@ -94,7 +96,7 @@ export function formatCurrency(value: number, currency: string, locale = 'en-US'
// Fallback to default currency format if an error occurs
formattedValue = new Intl.NumberFormat(locale, {
style: 'currency',
currency: 'USD',
currency: DEFAULT_CURRENCY,
});
}