mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 17:31:50 +00:00
Fixed formatting for small numbers
This commit is contained in:
parent
7aebcdeafc
commit
f06203dd32
2 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
# The Modding Tree changelog:
|
# The Modding Tree changelog:
|
||||||
|
|
||||||
- Fixed issues in the buyable docs
|
- Improved the display for extremely small numbers.
|
||||||
|
- Fixed issues in the buyable docs.
|
||||||
|
|
||||||
# v2.5.1 - 5/7/21
|
# v2.5.1 - 5/7/21
|
||||||
- Fixed dynamic things in tabFormat not updating.
|
- Fixed dynamic things in tabFormat not updating.
|
||||||
|
|
|
@ -59,12 +59,12 @@ function format(decimal, precision = 2, small) {
|
||||||
|
|
||||||
decimal = invertOOM(decimal)
|
decimal = invertOOM(decimal)
|
||||||
let val = ""
|
let val = ""
|
||||||
if (decimal.lt(1e1000)){
|
if (decimal.lt("1e1000")){
|
||||||
val = exponentialFormat(decimal, precision)
|
val = exponentialFormat(decimal, precision)
|
||||||
|
return val.replace(/([^(?:e|F)]*)$/, '-$1')
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = format(decimal, precision)
|
return format(decimal, precision) + "⁻¹"
|
||||||
return val.replace(/([^(?:e|F)]*)$/, '-$1')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue