Normalize formatUnits to simplified decimals.
This commit is contained in:
parent
e128bfcd10
commit
79b1da130b
@ -42,6 +42,9 @@ export function commify(value: string | number): string {
|
|||||||
|
|
||||||
let suffix = "";
|
let suffix = "";
|
||||||
if (comps.length === 2) { suffix = "." + (comps[1] || "0"); }
|
if (comps.length === 2) { suffix = "." + (comps[1] || "0"); }
|
||||||
|
while (suffix.length > 2 && suffix[suffix.length - 1] === "0") {
|
||||||
|
suffix = suffix.substring(0, suffix.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
const formatted = [];
|
const formatted = [];
|
||||||
while (whole.length) {
|
while (whole.length) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user