Skip to content

Commit

Permalink
Merge pull request #1059 from scroll-tech/sepolia
Browse files Browse the repository at this point in the history
merge sepolia into mainnet
  • Loading branch information
zzq0826 authored May 21, 2024
2 parents d05f092 + 93233b4 commit 1d9b577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll.io",
"version": "5.0.90",
"version": "5.0.91",
"private": false,
"license": "MIT",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const commafy = (value: string | number | undefined, decimals: number = 2
try {
return numbro(value).format({
thousandSeparated: true,
optionalMantissa: false,
optionalMantissa: true,
mantissa: decimals,
})
} catch (err) {
Expand Down Expand Up @@ -67,7 +67,8 @@ export const toPrecision = (amount, precise = 8) => {
}
const withPrecision = commafy(amount, significantDecimals)
// Remove trailing zeros after decimal point
return parseFloat(withPrecision).toString()
const withoutTrailingZero = withPrecision.replace(/(\.\d*?)0+$/, "$1").replace(/(\.\d+?)0+$/, "$10")
return withoutTrailingZero
}

export function sanitizeNumericalString(numStr: string) {
Expand Down

0 comments on commit 1d9b577

Please sign in to comment.