Expect to use Decimal.prototype.toFixed replace the original method ```javascript (function() { var originalToFixed = Number.prototype.toFixed; Number.prototype.toFixed = function(decimal) { if (window.Decimal && Decimal.prototype.toFixed) { return new Decimal(this).toFixed(decimal); } else { return originalToFixed(this, decimal); } }; )(); ``` TestCode (2).toFixed(2); will be run to line 4340 thrown error '[DecimalError] Invalid argument: 2' because line 4290 test typeof v returned 'object'pull/146/head
parent
5a6e1384d8
commit
07b8ae1437
Loading…
Reference in new issue