mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-10 17:36:53 +00:00
fixed float representation in compiled templates
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
* 1.36.1 (2018-XX-XX)
|
||||
|
||||
* fixed float representation in compiled templates
|
||||
* added a second argument to the join filter (last separator configuration)
|
||||
|
||||
* 1.36.0 (2018-12-16)
|
||||
|
||||
@@ -175,7 +175,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
setlocale(LC_NUMERIC, 'C');
|
||||
}
|
||||
|
||||
$this->raw($value);
|
||||
$this->raw(var_export($value, true));
|
||||
|
||||
if (false !== $locale) {
|
||||
setlocale(LC_NUMERIC, $locale);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Twig compiles floats properly
|
||||
--TEMPLATE--
|
||||
{% set val2 = 0.0 %}
|
||||
|
||||
{{ val is same as (0.0) ? 'Yes' : 'No' }}
|
||||
{{ val2 is same as (0.0) ? 'Yes' : 'No' }}
|
||||
{{ val is same as (val2) ? 'Yes' : 'No' }}
|
||||
--DATA--
|
||||
return array('val' => 0.0)
|
||||
--EXPECT--
|
||||
Yes
|
||||
Yes
|
||||
Yes
|
||||
Reference in New Issue
Block a user