bootstrap-rating.js
function (index) {
      // Get the closest top fraction.
      var fraction = Math.ceil(index % 1 * this.options.fractions) / this.options.fractions;
      // Truncate decimal trying to avoid float precission issues.
      var p = Math.pow(10, this.options.scale);
      return Math.floor(index) + Math.floor(fraction * p) / p;
    }
function (index) {
      // Get the closest top fraction.
      var fraction = Math.ceil(index % 1 * this.options.fractions) / this.options.fractions;
      // Truncate decimal trying to avoid float precission issues.
      var p = Math.pow(10, this.options.scale);
      return Math.floor(index) + Math.floor(fraction * p) / p;
    }
function ( index ) { // Get the closest top fraction. var fraction = Math . ceil ( index % 1 * this . options . fractions ) / this . options . fractions ; // Truncate decimal trying to avoid float precission issues. var p = Math . pow ( 10 , this . options . scale ) ; return Math . floor ( index ) + Math . floor ( fraction * p ) / p ; }
Round index to the configured opts.fractions.
Round index to the configured opts . fractions .