Re: Inconsistent float to string vs. string to float casting
| From: | Christoph M. Becker | Date: | Thu, 27 Dec 2018 18:09:59 +0000 |
| Subject: | Re: Inconsistent float to string vs. string to float casting | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103645@lists.php.net to get a copy of this message | ||
On 27.12.2018 at 18:57, Christoph M. Becker wrote:
> […] filter_var() with
> FILTER_VALIDATE_FLOAT can also be used, and might be the best option if
> you don't know which decimal separator is used, and you are sure there
> are no thousands separators in the string.
No, that doesn't work, since the 'decimal' separator must be one char.
I've mixed that up with the 'thousand' option available as of PHP 7.3.0.
--
Christoph M. Becker