Function __global->float_unformat

Definitions

sources/global3.php

  • Take the given formatted float number and convert it to a native float. The inverse of float_format.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$str string No No required parameter N/A N/A The formatted float number using the locale
$includes_thousands_sep boolean No No True N/A N/A Whether we expect a thousands separator, knowing this means we can be a bit smarter

Returns

  • Native float
  • Type: float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Take the given formatted float number and convert it to a native float. The inverse of float_format.
 *
 * @param  string $str The formatted float number using the locale
 * @param  boolean $includes_thousands_sep Whether we expect a thousands separator, knowing this means we can be a bit smarter
 * @return float Native float
 */

function float_unformat(string $str, bool $includes_thousands_sep = true) : float