Skip to content
Permalink
Browse files

Number: Added zero check for toPrecision

  • Loading branch information...
hmizutanitsi authored and rxaviers committed Apr 16, 2019
1 parent 751f459 commit ace5135562bc2254656d936b36d82eadd7e132bf
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/util/number/to-precision.js
@@ -14,6 +14,10 @@ define(function() {
return function( number, precision, round ) {
var roundOrder;

if ( number === 0 ) { // Fix #706
return number;
}

roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) );
roundOrder -= precision;

0 comments on commit ace5135

Please sign in to comment.
You can’t perform that action at this time.