fix 'finite number' bug, fix fiatBalance bug
This commit is contained in:
parent
6c1af87c88
commit
0fd54879f3
2 changed files with 6 additions and 3 deletions
|
|
@ -133,8 +133,11 @@ function formatCurrency (num, code) {
|
||||||
function emailAlert (alert) {
|
function emailAlert (alert) {
|
||||||
switch (alert.code) {
|
switch (alert.code) {
|
||||||
case 'ping':
|
case 'ping':
|
||||||
|
if (alert.age) {
|
||||||
var pingAge = prettyMs(alert.age, {compact: true, verbose: true})
|
var pingAge = prettyMs(alert.age, {compact: true, verbose: true})
|
||||||
return 'Connection to machine down for ' + pingAge
|
return 'Connection to machine down for ' + pingAge
|
||||||
|
}
|
||||||
|
return 'Machine down for a while or never connected'
|
||||||
case 'stale':
|
case 'stale':
|
||||||
var stuckAge = prettyMs(alert.age, {compact: true, verbose: true})
|
var stuckAge = prettyMs(alert.age, {compact: true, verbose: true})
|
||||||
return 'Machine is stuck on ' + alert.state + 'screen for ' + stuckAge
|
return 'Machine is stuck on ' + alert.state + 'screen for ' + stuckAge
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ exports.fiatBalance = function fiatBalance (cryptoCode) {
|
||||||
var unitScale = new BigNumber(10).pow(coins[cryptoCode].unitScale)
|
var unitScale = new BigNumber(10).pow(coins[cryptoCode].unitScale)
|
||||||
var fiatTransferBalance = lastBalance.div(unitScale).times(rate).div(lowBalanceMargin)
|
var fiatTransferBalance = lastBalance.div(unitScale).times(rate).div(lowBalanceMargin)
|
||||||
|
|
||||||
return fiatTransferBalance
|
return fiatTransferBalance.toFixed(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue