From 54114dc6d0c03cbb1caa36a64afed5b07b26138f Mon Sep 17 00:00:00 2001 From: Tesseract1234567890 Date: Wed, 2 Jun 2021 21:41:58 -0400 Subject: [PATCH] Edited formatAbsurdNumber; reinstated parts of formatShares --- src/ui/numeralFormat.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/numeralFormat.ts b/src/ui/numeralFormat.ts index ecd59b914..5029bdaa9 100644 --- a/src/ui/numeralFormat.ts +++ b/src/ui/numeralFormat.ts @@ -52,7 +52,7 @@ class NumeralFormatter { return this.format(n, "0.000a"); } - formatAbsurdNumber(n: number, decimalPlaces: number): string { + formatAbsurdNumber(n: number, decimalPlaces = 3): string { for(let i = 0; i < extraFormats.length; i++) { if(extraFormats[i] < n && n <= extraFormats[i]*1000) { return this.format(n/extraFormats[i], '0.'+'0'.repeat(decimalPlaces))+extraNotations[i]; @@ -140,6 +140,9 @@ class NumeralFormatter { } formatShares(n: number): string { + if (n < 1000) { + return this.format(n, "0"); + } return this.formatAbsurdNumber(n, 3); }