[FIX] fraction_part is a string

This commit is contained in:
Geert Weening
2014-10-16 14:05:26 -07:00
parent 9c080b6790
commit d42e06d48b

View File

@@ -1113,7 +1113,7 @@ Amount.prototype.to_human = function(opts) {
if (typeof opts.precision === 'number') {
if (opts.precision <= 0 && fraction_part.charCodeAt(0) >= 53) {
int_part = (Number(int_part) + 1).toString();
fraction_part = [];
fraction_part = '';
} else {
fraction_part = Math.round(fraction_part / Math.pow(10, fraction_part.length - opts.precision)).toString();
}