mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 15:45:48 +00:00
[FIX] fraction_part is a string
This commit is contained in:
@@ -1113,7 +1113,7 @@ Amount.prototype.to_human = function(opts) {
|
|||||||
if (typeof opts.precision === 'number') {
|
if (typeof opts.precision === 'number') {
|
||||||
if (opts.precision <= 0 && fraction_part.charCodeAt(0) >= 53) {
|
if (opts.precision <= 0 && fraction_part.charCodeAt(0) >= 53) {
|
||||||
int_part = (Number(int_part) + 1).toString();
|
int_part = (Number(int_part) + 1).toString();
|
||||||
fraction_part = [];
|
fraction_part = '';
|
||||||
} else {
|
} else {
|
||||||
fraction_part = Math.round(fraction_part / Math.pow(10, fraction_part.length - opts.precision)).toString();
|
fraction_part = Math.round(fraction_part / Math.pow(10, fraction_part.length - opts.precision)).toString();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user