We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a607ab commit 1ed4504Copy full SHA for 1ed4504
src/Exception/Value/JsonLikeValuePrinter.php
@@ -151,14 +151,8 @@ private function printFloat(float $value): string
151
*/
152
private function printWellFormedFloat(float $value): string
153
{
154
- /** @var non-empty-string $formatted */
155
- $formatted = \rtrim(\sprintf('%f', $value), '0');
156
-
157
- if (\str_ends_with($formatted, '.')) {
158
- $formatted .= '0';
159
- }
160
161
- return $formatted;
+ /** @var non-empty-string */
+ return \sprintf('%h', $value);
162
}
163
164
/**
0 commit comments