Skip to content

Commit

Permalink
Fix exchange-rate displayed-decimals computation
Browse files Browse the repository at this point in the history
Thanks @danimoh for finding it: #465 (comment)
  • Loading branch information
sisou committed Nov 26, 2023
1 parent 284e56c commit 9bd7e94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/request/sign-swap/SignSwap.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class SignSwap {
const exchangeRateDigitsLength = exchangeRate
.toFixed(CryptoUtils.assetDecimals(exchangeOtherAsset) + 1)
.split('.')[0]
.replace('0', '')
.replace(/^0/ , '') // Remove 0 when the number is < 1
.length;
const exchangeRateDecimals = Math.max(
0,
Expand Down

0 comments on commit 9bd7e94

Please sign in to comment.