Upgrade to 3.0.2

This commit is contained in:
Bastian Allgeier
2019-02-19 16:39:58 +01:00
parent f76ee1bb14
commit 8e3d86a590
44 changed files with 638 additions and 264 deletions

View File

@@ -336,6 +336,20 @@ class Str
return static::substr($string, 0, strrpos(static::substr($string, 0, $chars), ' ')) . ' ' . $rep;
}
/**
* Convert the value to a float with a decimal
* point, no matter what the locale setting is
*
* @param string|int|float $value
* @return string
*/
public static function float($value): string
{
$value = str_replace(',', '.', $value);
$decimal = strlen(substr(strrchr($value, "."), 1));
return number_format((float)$value, $decimal);
}
/**
* Returns the rest of the string starting from the given character
*