1
0
Fork 0
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:
Harley White 2021-05-07 18:53:49 -04:00
parent 7aebcdeafc
commit f06203dd32
2 changed files with 5 additions and 4 deletions

View file

@ -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.

View file

@ -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')
} }