mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-23 07:34:20 +08:00
(feature)(chat-sdk) add unit (#2067)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user