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:
parent
6fc85143ca
commit
7f82d20cca
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user