mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
parent
4a7d011317
commit
5a3a1ec25c
@ -182,6 +182,11 @@ class Standard extends PrettyPrinterAbstract
|
||||
$stringValue = sprintf('%.17G', $node->value);
|
||||
}
|
||||
|
||||
// %G is locale dependent and there exists no locale-independent alternative. We don't want
|
||||
// mess with switching locales here, so let's assume that a comma is the only non-standard
|
||||
// decimal separator we may encounter...
|
||||
$stringValue = str_replace(',', '.', $stringValue);
|
||||
|
||||
// ensure that number is really printed as float
|
||||
return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user