Here you can find the source of to_i()
Number.prototype.to_i = function () { return parseInt(this.valueOf()); };
Number.prototype.toInt = function() { return (this | 0); };
Number.prototype.toInt = function(){ return parseInt(this); };
Number.prototype.toIntZero = function(){ var val = parseInt(this); if(isNaN(val)){ return 0; }else{ return val }; var cards = angular.module('app', []); ...
Number.prototype.toInteger = function ( thousandsSeparator ) { var n, startAt, intLen; if ( thousandsSeparator == null ) thousandsSeparator = ","; n = this.round( 0, true ); intLen = n.length; if ( (startAt = intLen % 3) == 0 ) startAt = 3; for ( var i = 0, len = Math.ceil( intLen / 3 ) - 1; i < len; i++ )n = n.insertAt( i * 4 + startAt, thousandsSeparator ); return n; }; ...
Number.prototype.to_i = function() { return Math.floor(this); }; console.log((5.276).to_i()); _n = function(operateOn){ self = {} self.to_i = function() { return Math.floor(operateOn); }; ...