Skip to content

Instantly share code, notes, and snippets.

View alamilladev's full-sized avatar
🚀
Lifelong learning

Armando Alamilla Cuellar alamilladev

🚀
Lifelong learning
View GitHub Profile
@alamilladev
alamilladev / formarnumbers.ts
Last active September 13, 2023 02:45
Typescript function to format numbers with currency, thousand separators, fixed and significant decimals.
export const defaultCurrency = {
id: 'USD',
symbol: '$',
full: 'USD$',
};
export const isNegative = (num: number): boolean => num < 0;
/**
* ===========================================