File size: 418 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Convert time to hours and minutes
export const calcTime = (time) => {
const hours = Math.floor(time / 60);
const mins = time % 60;
return `${hours}h ${mins}m`;
}
// Convert a number to money formatting
export const convertMoney = (money) => {
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
});
return formatter.format(money);
} |