code: function(num, max) {
              max = max || Infinity;
              var precision = 0;
  
              while(precision < max && num.toFixed(precision) !== num.toString()) {
                  precision += 1;
              }
  
              return precision;
          }
docs: returns the number of digits of precision after the decimal point optionally accepts a maximum number, after which point it will stop looking and return the max