Merge pull request #100 from lbryio/to-fixed
fix creditsToString function for small decimals
This commit is contained in:
commit
6139cede26
2 changed files with 5 additions and 14 deletions
9
dist/bundle.js
vendored
9
dist/bundle.js
vendored
|
@ -1921,8 +1921,7 @@ function doAbandonClaim(txid, nout) {
|
|||
var _myClaims$find = myClaims.find(function (claim) {
|
||||
return claim.txid === txid && claim.nout === nout;
|
||||
}),
|
||||
claimId = _myClaims$find.claim_id,
|
||||
name = _myClaims$find.name;
|
||||
claimId = _myClaims$find.claim_id;
|
||||
|
||||
dispatch({
|
||||
type: ACTIONS.ABANDON_CLAIM_STARTED,
|
||||
|
@ -4557,13 +4556,9 @@ function formatFullPrice(amount) {
|
|||
}
|
||||
|
||||
function creditsToString(amount) {
|
||||
var creditString = String(amount);
|
||||
|
||||
if (creditString.includes('.')) {
|
||||
var creditString = parseFloat(amount).toFixed(8);
|
||||
return creditString;
|
||||
}
|
||||
return creditString + '.0';
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
/* 26 */
|
||||
|
|
|
@ -24,10 +24,6 @@ export function formatFullPrice(amount, precision = 1) {
|
|||
}
|
||||
|
||||
export function creditsToString(amount) {
|
||||
const creditString = String(amount);
|
||||
|
||||
if (creditString.includes('.')) {
|
||||
const creditString = parseFloat(amount).toFixed(8);
|
||||
return creditString;
|
||||
}
|
||||
return `${creditString}.0`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue