Formatters
currency | formatCurrency(1000000) | $1,000,000.00 |
currency | formatCurrencyCompact(1000000) | $1M |
currency | formatCurrencyShort(1000000) | $1,000,000 |
percent | formatPercent(0.7556) | 75.6% |
percent | formatPercentCompact(0.7556) | 76% |
percent | formatPercentFull(0.7556) | 75.56% |
number | formatInteger(12345.6789) | 12346 |
number | formatIntegerCompact(12345.6789) | 12K |
number | formatDecimal(12345.6789) | 12345.68 |
date | formatDate(new Date()) | 2025-10-26 |
date | formatDateAmerican(new Date()) | 10/26/2025 |
date | formatDateText(new Date()) | Oct 26, 2025 |
date | formatDateTextFull(new Date()) | October 26, 2025 |
date | formatMonthYear(new Date()) | 2025-10 |
date | formatMonthYearText(new Date()) | Oct 2025 |
date | formatMonthYearTextFull(new Date()) | October 2025 |
date | formatYear(new Date()) | 2025 |
date | formatTimeAgo(new Date(2023, 1, 1)) | 2 years ago |
boolean | formatBoolean(1) | True |
boolean | formatBooleanYesNo(1) | Yes |
text | formatTextCapitalize("hello world") | Hello world |
text | formatTextTruncate('The quick brown fox jumps over the lazy dog', 20) | The quick brown fox … |
text | formatTextTruncateMiddle('The quick brown fox jumps over the lazy dog', 20) | The quick … lazy dog |