[php-src] Issue #8509: Float to string cast/conversion should never produce more decimal digits than needed
| From: | mvorisek | Date: | Sat, 07 May 2022 11:15:59 +0000 |
| Subject: | [php-src] Issue #8509: Float to string cast/conversion should never produce more decimal digits than needed | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241432@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8509
Author: mvorisek
### Description
```
<?php
ini_set('precision', 50);
var_dump((string) 1.5);
var_dump((string) 8.20234376757473);
```
outputs:
```
string(3) "1.5"
string(51) "8.2023437675747299380191179807297885417938232421875"
```
but I expect:
```
string(3) "1.5"
string(51) "8.20234376757473"
```
displaying more decimal digits than needed is not helpful