mirror of
https://github.com/thepaperpilot/The-Modding-Tree.git
synced 2025-05-10 12:01:29 +00:00
FormatWhole now displays decimals for numbers less than 1.
This commit is contained in:
parent
9a4302b56a
commit
dbff7b3f5f
4 changed files with 8 additions and 5 deletions
js
|
@ -54,6 +54,7 @@ function format(decimal, precision=2) {
|
|||
function formatWhole(decimal) {
|
||||
decimal = new Decimal(decimal)
|
||||
if (decimal.gte(1e9)) return format(decimal, 2)
|
||||
if (decimal.lte(0.95) && !decimal.eq(0)) return format(decimal, 2)
|
||||
return format(decimal, 0)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue