Skip to content

Commit

Permalink
Improve prenet number formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Jan 29, 2024
1 parent ff3ecb9 commit 39cbaaa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions prenet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,16 @@
back = back.split("").reverse().join("");
back = back.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
back = "." + back.split("").reverse().join("");
// cutting down to the most significant digits
back = back.replace(/(0[1-9][1-9]|[1-9][1-9]0|[1-9]0[1-9]|00[1-9]|[1-9]00|0[1-9]0).*/, "$1")
} else {
back = "";
}

// value = value.toString()h
return front + back + unit
if (front.length > 4)
return front + unit
else
return front + back + unit
}

function isAddress(value) {
Expand Down

0 comments on commit 39cbaaa

Please sign in to comment.