(feature)(chat-sdk) add unit (#2067)

This commit is contained in:
williamhliu
2025-02-18 19:21:13 +08:00
committed by GitHub
parent b743585d3e
commit e04bc3cce8
8 changed files with 15966 additions and 12767 deletions

View File

@@ -93,7 +93,9 @@ export const getFormattedValue = (value: number | string, remainZero?: boolean)
export const formatNumberWithCN = (num: number) => {
if (isNaN(num)) return '-';
if (num >= 10000) {
if (num >= 100000000) {
return (num / 100000000).toFixed(1) + '亿';
} else if (num >= 10000) {
return (num / 10000).toFixed(1) + '万';
} else {
return formatByDecimalPlaces(num, 2);