Skip to content

Commit f902096

Browse files
committed
Update NumberFormating.js
1 parent e292224 commit f902096

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

MeTMT/js/utils/NumberFormating.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ function standardFormat(decimal) {
142142
[
143143
"", "C", "D", "Tc", "Qc", "qc", "Sc", "sc", "Oc", "Nc"
144144
],
145-
[
146-
"", "Mi", "D-Mi", "T-Mi", "Q-Mi", "q-Mi", "S-Mi", "s-Mi", "O-Mi", "N-Mi"
147-
],
148145
]
149146
decimal = new Decimal(decimal)
150147
if (decimal.eq(0)) return "0"
151148
e = decimal.log10().div(3).floor().clampMin(0)
152149
prefix = ""
153-
prefix += symbols[3][e.div(1000).floor().mod(10)]
150+
prefix += symbols[0][e.div(10000).floor().mod(10)]
151+
prefix += symbols[1][e.div(100000).floor().mod(10)]
152+
prefix += symbols[2][e.div(1000000).floor().mod(10)]
153+
prefix += e.div(1000).floor().mod(10).neq(0) ? "Mi" : ""
154154
prefix += symbols[0][e.sub(1).mod(10)]
155155
prefix += symbols[1][e.div(10).floor().mod(10)]
156156
prefix += symbols[2][e.div(100).floor().mod(10)]

0 commit comments

Comments
 (0)