mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-09 16:01:39 -04:00
8 lines
381 B
TypeScript
8 lines
381 B
TypeScript
const numToCommas = (num: number) => Intl.NumberFormat('en-US').format(num);
|
|
const EDUCATION_HOURS_PER_DOLLAR = 50;
|
|
export const CENTS_IN_DOLLAR = 100;
|
|
export const convertToTimeContributed = (amount: number) =>
|
|
numToCommas((amount / CENTS_IN_DOLLAR) * EDUCATION_HOURS_PER_DOLLAR);
|
|
export const formattedAmountLabel = (amount: number) =>
|
|
numToCommas(amount / CENTS_IN_DOLLAR);
|