Skip to content

Commit

Permalink
Update NumberFormating.js
Browse files Browse the repository at this point in the history
  • Loading branch information
WiktorProj committed Sep 8, 2024
1 parent e292224 commit f902096
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MeTMT/js/utils/NumberFormating.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ function standardFormat(decimal) {
[
"", "C", "D", "Tc", "Qc", "qc", "Sc", "sc", "Oc", "Nc"
],
[
"", "Mi", "D-Mi", "T-Mi", "Q-Mi", "q-Mi", "S-Mi", "s-Mi", "O-Mi", "N-Mi"
],
]
decimal = new Decimal(decimal)
if (decimal.eq(0)) return "0"
e = decimal.log10().div(3).floor().clampMin(0)
prefix = ""
prefix += symbols[3][e.div(1000).floor().mod(10)]
prefix += symbols[0][e.div(10000).floor().mod(10)]
prefix += symbols[1][e.div(100000).floor().mod(10)]
prefix += symbols[2][e.div(1000000).floor().mod(10)]
prefix += e.div(1000).floor().mod(10).neq(0) ? "Mi" : ""
prefix += symbols[0][e.sub(1).mod(10)]
prefix += symbols[1][e.div(10).floor().mod(10)]
prefix += symbols[2][e.div(100).floor().mod(10)]
Expand Down

0 comments on commit f902096

Please sign in to comment.