Here you can find the source of to_f()
Number.prototype.to_f = function () { return parseFloat(this.valueOf()); };