1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00

Fix pretty printing of whole-numbered floats

This commit is contained in:
nikic 2011-10-16 14:36:45 +02:00
parent 6fc85143ca
commit 7f82d20cca

View File

@ -78,7 +78,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
}
public function pScalar_DNumber(PHPParser_Node_Scalar_DNumber $node) {
return (int) $node->value == $node->value
return (string) (int) $node->value == (string) $node->value
? (string) $node->value . '.0' // ensure that number is really printed as float
: (string) $node->value;
}