Skip to content

Commit

Permalink
Fix NAS nano amount display exception
Browse files Browse the repository at this point in the history
  • Loading branch information
PingNeb committed May 5, 2019
1 parent b5703a2 commit 7c90159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function getInfo() {
return;
}
f();
stateView.val(amount === 0 ?
stateView.val(amount === "0" ?
address + " have not pledge." :
address + " pledge " + amount + " NAS."
);
Expand Down
8 changes: 4 additions & 4 deletions client/js/pledge.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function _queryPledgeState() {
if (amount == null) {
return;
}
$("#nano_pledge_state").val(amount === 0 ?
$("#nano_pledge_state").val(amount === "0" ?
a + " have not pledge." :
a + " pledge " + amount + " NAS."
);
Expand Down Expand Up @@ -104,9 +104,9 @@ function getPledgeAmount(address, callback) {
} else {
let p = JSON.parse(r.result);
if (p && !p.c) {
callback(p.v);
callback(NebUtils.toBigNumber(p.v).toString(10));
} else {
callback(0);
callback("0");
}
}
}).catch(function (e) {
Expand All @@ -125,7 +125,7 @@ function genCode() {
}
var value = "0";
if (nanoAction === 0) {
value = NebUnit.nasToBasic($("#nano_amount").val());
value = NebUnit.nasToBasic($("#nano_amount").val()).toString(10);
}
var params = {
"pageParams": {
Expand Down

0 comments on commit 7c90159

Please sign in to comment.