From 50c6eea630c5bf6d1513d093125f11ce30deaff5 Mon Sep 17 00:00:00 2001 From: jloup Date: Mon, 26 Mar 2018 10:55:17 +0200 Subject: Display short positions. --- cmd/web/js/poloniex.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 813a506..db6b1c4 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -113,6 +113,10 @@ class PoloniexBalance extends React.Component { this.state = {'hideMsg': true, 'msg': '', 'msgOk': false}; } + computeCurrencyRatio = (currency) => { + return (parseFloat(this.props.balance[currency].btcValue) / parseFloat(this.props.balanceValue) * 100.0).toFixed(1); + } + render = () => { var dashboard = null; @@ -120,16 +124,18 @@ class PoloniexBalance extends React.Component { var balance = Object.keys(this.props.balance).map(function(currency) { return
- {this.props.balance[currency]} +
+ {this.props.balance[currency].amount} {currency} ({this.computeCurrencyRatio(currency)}%) +
; }.bind(this)); dashboard =
-
+
{balance}
-
+
Balance ({this.props.balanceCurrency}): {this.props.balanceValue}
-- cgit v1.2.3