Here you can find the source of toFloat()
String.prototype.toFloat = function(){ return parseFloat(this); } // Calculate the angle based on a point and the center of a cirle function angle(cx, cy, ex, ey) { var dy = ey - cy; var dx = ex - cx; var theta = Math.atan2(dy, dx); // range (-PI, PI] theta *= 180 / Math.PI; // rads to degs, range (-180, 180] return theta;//ww w . j a va 2 s . c o m } // Calculate the angle based on a point and the center of a cirle function angle360(cx, cy, ex, ey) { var theta = angle(cx, cy, ex, ey); // range (-180, 180] if (theta < 0) theta = 360 + theta; // range [0, 360) return theta; } // Calculate the correct length of the arm function limit(x, y, cx, cy, cr) { x = x - cx; y = y - cy; var radians = Math.atan2(y, x); return { x: (Math.cos(radians) * cr) + cx, y: (Math.sin(radians) * cr) + cy } }
Number.prototype.tryParseToFixed = function(decimalPlaces) { if(!decimalPlaces) decimalPlaces = 0; if (isNaN(this)) { throw this + ' could not be converted to a Number.'; return parseFloat(this).toFixed(decimalPlaces);
String.prototype.toFloat = function() { return parseFloat(this);
String.prototype.toFloat = function(){ return parseFloat(this); };
String.prototype.toFloat = function() var regexFloat = /[^0-9\.]+/g; this.number = this; this.number = this.number.replace( regexFloat, '' ); this.number = ( Math.round( this.number * 100) / 100).toFixed(2); return this.number;
String.prototype.toFloat = Number.prototype.toFloat = jCube.String.toFloat = function ( alt) { return parseFloat(this).check( alt||0); jCube.Include("Number.check");