Upgrade to 3.0.2
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user