1
0
Fork 0
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:
Acamaeda 2020-10-25 22:36:38 -04:00
parent 9a4302b56a
commit dbff7b3f5f
4 changed files with 8 additions and 5 deletions

View file

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