From 51cc30532dd2c4a8134149af77fc2da167a895ea Mon Sep 17 00:00:00 2001 From: Sky Young Date: Tue, 22 May 2018 14:22:05 -0700 Subject: [PATCH] Parse fee correctly --- package.json | 2 +- public/src/js/controllers/currency.js | 15 ++++++++++++++- public/views/transaction/tx.html | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4d5af9e..07dd351 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "flosight-ui", "description": "An open-source frontend for the Flosight API. The Flosight API provides you with a convenient, powerful and simple way to query and broadcast data on the florincoin network and build your own services with it.", - "version": "5.0.0-beta.70", + "version": "5.0.0-beta.71", "repository": "git://github.com/bitpay/flosight-ui.git", "bugs": { "url": "https://github.com/bitpay/flosight-ui/issues" diff --git a/public/src/js/controllers/currency.js b/public/src/js/controllers/currency.js index 27d24a2..30a1cb0 100644 --- a/public/src/js/controllers/currency.js +++ b/public/src/js/controllers/currency.js @@ -19,7 +19,20 @@ angular.module('flosight.currency').controller('CurrencyController', var response; if (this.symbol === 'USD') { - response = _roundFloat((value * this.factor), 2); + var USDValue = value * this.factor; + response = USDValue.toFixed(2) + + if (parseFloat(response) === 0) + response = USDValue.toFixed(4) + + if (parseFloat(response) === 0) + response = USDValue.toFixed(6) + + if (parseFloat(response) === 0) + response = USDValue.toFixed(8) + + if (parseFloat(response) === 0) + response = 0; } else if (this.symbol === 'mFLO') { this.factor = 1000; response = _roundFloat((value * this.factor), 5); diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 4906c9b..07ad990 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -200,13 +200,13 @@
Fee: {{$root.currency.getConvertion(tx.fees) || tx.fees + 'BTC'}} + class="txvalues txvalues-default">Fee: {{$root.currency.getConvertion(tx.fees) || tx.fees + 'FLO'}}
{{tx.confirmations}} Confirmations Unconfirmed Transaction! - {{$root.currency.getConvertion(tx.valueOut) || tx.valueOut + ' BTC' }} + {{$root.currency.getConvertion(tx.valueOut) || tx.valueOut + ' FLO' }}