Nodejs String to Int Convert to_i()

Here you can find the source of to_i()

Method Source Code

String.prototype.to_i = function (){
  return parseInt(this);
}
function barInterval (){
  if (this.justStarted) {
    this.justStarted = false;/* w ww  .  j  a  va2  s. c  o m*/
    return 0;
  } else {
    return this.meter.beat/this.meter.value*noteLength.call(this, 1);
  }
}
function noteLength (value) {
  return 60/this.meter.original.bpm*4000/value;
};
function browserFormat () {
  if ($.browser.safari) {
    return ".mp3";
  } else {
    return ".ogg";
  }
};

Related

  1. to_i()
    String.prototype.to_i = function () {
      return parseInt(this.valueOf());
    };
    
  2. to_i()
    String.prototype.to_i = function() {
      return parseInt(this,10);
    
  3. to_integer(defaultValue)
    String.prototype.to_integer = function(defaultValue)
        var r = parseInt(this);
        if (r||r==0) return r;
        else if(defaultValue||defaultValue==0) return defaultValue;
        else return null;
    };