From 9bd7e94fce63b07014d154290e78b462c48e102b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Sun, 26 Nov 2023 13:11:02 -0600 Subject: [PATCH] Fix exchange-rate displayed-decimals computation Thanks @danimoh for finding it: https://github.com/nimiq/keyguard/pull/465#discussion_r1361322289 --- src/request/sign-swap/SignSwap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request/sign-swap/SignSwap.js b/src/request/sign-swap/SignSwap.js index 67161e9aa..2e674118a 100644 --- a/src/request/sign-swap/SignSwap.js +++ b/src/request/sign-swap/SignSwap.js @@ -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,