lib/helpers.js
function getNumber (type, min, max, format, options) {
  var ret;

  // Juggle the arguments if the user didn't supply a format string
  if (!options) {
    options = format;
    format = null;
  }

  if (type === 'int') {
    ret = utils.randomInt(min, max);
  } else if (type === 'float') {
    ret = utils.randomFloat(min, max);
  }

  if (typeof options.hash.round === 'number') {
    ret = Math.round(ret / options.hash.round) * options.hash.round;
  }

  if (format) {
    ret = numbro(ret).format(format);
  }

  return ret;
}
function getNumber (type, min, max, format, options) {
  var ret;

  // Juggle the arguments if the user didn't supply a format string
  if (!options) {
    options = format;
    format = null;
  }

  if (type === 'int') {
    ret = utils.randomInt(min, max);
  } else if (type === 'float') {
    ret = utils.randomFloat(min, max);
  }

  if (typeof options.hash.round === 'number') {
    ret = Math.round(ret / options.hash.round) * options.hash.round;
  }

  if (format) {
    ret = numbro(ret).format(format);
  }

  return ret;
}
function getNumber ( type , min , max , format , options ) { var ret ; // Juggle the arguments if the user didn't supply a format string if ( ! options ) { options = format ; format = null ; } if ( type === 'int' ) { ret = utils . randomInt ( min , max ) ; } else if ( type === 'float' ) { ret = utils . randomFloat ( min , max ) ; } if ( typeof options . hash . round === 'number' ) { ret = Math . round ( ret / options . hash . round ) * options . hash . round ; } if ( format ) { ret = numbro ( ret ) . format ( format ) ; } return ret ; }
Generating int and floats is very similar so we route both to this single function
Generating int and floats is very similar so we route both to this single function