Here you can find the source of toFloat(alt)
/*/*www.j a v a2 s . c om*/ String.toFloat() rog?o sampaio 2008, Jan 7 Syntax: Number.toFloat( alt) Parameter: Number alt - Optional. An alternative number to return if Number is null or NaN Return: Capitalized string Requirements: jCube.Number.check Sample: "1234.213".toFloat() == 1324.213 "asdf".toFloat() == 0 */ String.prototype.toFloat = Number.prototype.toFloat = jCube.String.toFloat = function ( alt) { return parseFloat(this).check( alt||0); } jCube.Include("Number.check");
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(){ return parseFloat(this); function angle(cx, cy, ex, ey) { var dy = ey - cy; var dx = ex - cx; var theta = Math.atan2(dy, dx); theta *= 180 / Math.PI; return theta; ...
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;