Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张善主
2024-06-26 16:36:40 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
d82cfc95956109f1ac591c7ecc3cc2fa10a79a2f
d82cfc95
2 parents
90f70742
7d8dd998
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
View file @
d82cfc9
...
...
@@ -76,8 +76,15 @@ export struct CardSourceInfo {
const num2: string = num.slice(-4, -3); // 千
return num2 === '0' ? num1 + '万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
let num1: string = num.slice(0, -8); // 亿
let num2: string = num.slice(-8, -7);
const num3: string = `0.${num.slice(-7, -6)}`
if (Math.round(Number(num3)) > Number(num3)) {
if (`${Number(num2) + 1}`.length === 2) {
num1 = `${Number(num1) + 1}`
num2 = '0'
}
}
return num2 === '0' ? num1 + '亿' : num1 + '.' + num2 + '亿'
}
return num
...
...
Please
register
or
login
to post a comment