Javascript String toFloat()

Description

Javascript String toFloat()


/*/*from  w w w  .  j  a  v a2  s.c o m*/
 * String.toFloat.js
 * 
 * Copyright (c) 2012 Tomasz Jakub Rup <tomasz.rup@gmail.com>
 *
 * https://github.com/tomi77/Date.toLocaleFormat/
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

/**
 * Return a float representation of string.
 * 
 * @return float
 */
String.prototype.toFloat = function() {
 return parseFloat(this);
}



PreviousNext

Related