Skip to content

Commit

Permalink
Fixed a bug related to float values in the TOML output
Browse files Browse the repository at this point in the history
  • Loading branch information
tg666 committed Apr 17, 2020
1 parent 526a53e commit 808aafe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/TomlBuilder.php
Expand Up @@ -373,7 +373,13 @@ private function dumpInteger(int $val) : string

private function dumpFloat(float $val) : string
{
return strval($val);
$result = strval($val);

if ($val == floor($val)) {
$result .= '.0';
}

return $result;
}

private function isStringValid(string $val) : bool
Expand Down

0 comments on commit 808aafe

Please sign in to comment.