From d5c7a078484e51b2a8946aed5ee10a1abb5c89d9 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Tue, 7 May 2019 20:48:15 -0400 Subject: [PATCH] properly show 2 decimal places for exchanged amts --- app/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils.js b/app/utils.js index 8cee7bb..73eed85 100644 --- a/app/utils.js +++ b/app/utils.js @@ -202,8 +202,9 @@ function formatExchangedCurrency(amount, exchangeType) { if (global.exchangeRates != null && global.exchangeRates[exchangeType.toLowerCase()] != null) { var dec = new Decimal(amount); dec = dec.times(global.exchangeRates[exchangeType.toLowerCase()]); + var exchangedAmt = parseFloat(Math.round(dec * 100) / 100).toFixed(2); - return "$" + addThousandsSeparators(dec.toDecimalPlaces(2)); + return "$" + addThousandsSeparators(exchangedAmt); } return "";