Forum

Posted by
Matthew Hardy  -  March 2010
<set variable="var.test" expr="0.00+13816.88"/>

result: 13816.9

Anyone worked out the float?

For now the way is remove floating point and use re-convert as a string to float pike tag if this kind of process is to be kept in rxml.
 
Posted by
Jonas Wallden  -  March 2010
I'm unable to reproduce that in a quick test:

<set variable="var.test" expr="0.00 + 13816.88" />
<p>result: &var.test;</p>

...which gives "result: 13816.88"

Can you please post a full code example, version number and what RXML compatibility level  your site is using?
 
Posted by
Jonas Wallden  -  March 2010
More testing confirms that this is a 32-/64-bit issue. Pike now only includes significant digits when printing or converting a float to string.

It was changed in Pike 7.8 last year and unfortunately I overlooked that change when I compiled the 5.0-rel3 changelog.
 
Posted by
Matthew Hardy  -  March 2010
More testing confirms that this is a 32-/64-bit issue. Pike now only includes significant digits when printing or converting a float to string.

It was changed in Pike 7.8 last year and unfortunately I overlooked that change when I compiled the 5.0-rel3 changelog.


If that is the case it might be nice to enable a keep-decimal='place' feature to carry floats for the expr="".
 
1
Search this thread: