From 9de69124cdec6d3c48e209cf2ef236a43d7fbcf4 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Mon, 4 Sep 2017 19:00:35 -0500 Subject: [PATCH] fix(satsToUsd): display <0.01 if micropayment is less than a penny --- app/utils/btc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/btc.js b/app/utils/btc.js index 9d05fbfe..4de31dc5 100644 --- a/app/utils/btc.js +++ b/app/utils/btc.js @@ -13,7 +13,8 @@ export function satoshisToBtc(satoshis) { } export function btcToUsd(btc, price) { - return parseFloat((btc * price).toFixed(2)).toLocaleString('en') + const amount = parseFloat(btc * price).toFixed(2) + return (btc > 0 && amount <= 0) ? '< 0.01' : amount.toLocaleString('en') } export function satoshisToUsd(satoshis, price) {