mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +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:
|
||||
|
||||
- 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
|
||||
- Fixed dynamic things in tabFormat not updating.
|
||||
|
|
|
@ -59,12 +59,12 @@ function format(decimal, precision = 2, small) {
|
|||
|
||||
decimal = invertOOM(decimal)
|
||||
let val = ""
|
||||
if (decimal.lt(1e1000)){
|
||||
if (decimal.lt("1e1000")){
|
||||
val = exponentialFormat(decimal, precision)
|
||||
return val.replace(/([^(?:e|F)]*)$/, '-$1')
|
||||
}
|
||||
else
|
||||
val = format(decimal, precision)
|
||||
return val.replace(/([^(?:e|F)]*)$/, '-$1')
|
||||
return format(decimal, precision) + "⁻¹"
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue