|
|
|
@ -285,7 +285,17 @@ export const formatThousand = (x) => {
|
|
|
|
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const formatLargeNumber = (num) => { |
|
|
|
|
const formattedNum = formatThousand(num); |
|
|
|
|
if (num >= 1000000000000) { |
|
|
|
|
return `${(num / 1000000000000).toFixed(1)}T`; |
|
|
|
|
} else if (num >= 1000000000) { |
|
|
|
|
return `${(num / 1000000000).toFixed(1)}M`; |
|
|
|
|
} else if (num >= 1000000) { |
|
|
|
|
return `${(num / 1000000).toFixed(1)}Jt`; |
|
|
|
|
} |
|
|
|
|
return formattedNum; |
|
|
|
|
}; |
|
|
|
|
/* |
|
|
|
|
Using it: |
|
|
|
|
sortBy(data, { |
|
|
|
|