fixing Numbers formatting (#14403)

fix #13880

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
Ketan Mehta
2025-09-18 02:33:33 +05:30
committed by GitHub
parent 666b99524a
commit dc26e48f6f
36 changed files with 583 additions and 96 deletions
@@ -1,6 +1,6 @@
import { isDefined } from 'twenty-shared/utils';
import { formatAmount } from '~/utils/format/formatAmount';
import { formatNumber } from '~/utils/format/number';
import { formatNumber } from '~/utils/format/formatNumber';
import { formatToShortNumber } from '~/utils/format/formatToShortNumber';
export type GraphValueFormatOptions = {
displayType?: 'percentage' | 'number' | 'shortNumber' | 'currency' | 'custom';
@@ -31,7 +31,7 @@ export const formatGraphValue = (
return `${formatNumber(value * 100, decimals)}%`;
case 'shortNumber':
return `${prefix}${formatAmount(value)}${suffix}`;
return `${prefix}${formatToShortNumber(value)}${suffix}`;
case 'currency': {
const currencyPrefix = prefix || '$';