/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
apps/dashboard/src/utils/format-count.ts
17 строк
511 B
Dima Grossman
feat(api-service, dashboard): align tables all across the dashboard workflows subscribers fixes NV-6459 (#9239)
29 сен 2025, 15:43
Не верифицирован
29 сен 2025, 15:43
18e808e
Код
Авторство
О чём код?
export function formatCount(count: number, threshold: number = 500): string { if (count > threshold) { return `${threshold}+`; } return count.toString(); } export function formatCountForTooltip(count: number, isCapped: boolean): string { // If the backend indicates the count is capped (at 50k), show the + sign // Otherwise, show the exact count even if it's above our client-side 500 threshold if (isCapped) { return `${count.toLocaleString()}+`; } return count.toLocaleString(); }