Subtraction of negative numbers using {math+...}
Posted: Sun Dec 28, 2008 7:33 pm
On a html template I use the mathPLUS facility to work out the difference between 2 temp sensors.
<aside>
mathPLUS is not really written like that, but if I try to write it correctly, Joomla seems to 'eat' the plus sign, so where you see mathPLUS just imagine that it's math followed by a plus sign!
</aside>
For several months I've been using:
{mathPLUS -[actual_th0_temp_c] [actual_t8_temp_c]}
Last night I noticed that the calculation was failing. The problem seemed to be that actual_th0_temp_c was negative.
Today I tried to get around that by replacing the simple negative prefix with a nested math*, i.e.:
{mathPLUS {math* -1.0 [actual_th0_temp_c]} [actual_t8_temp_c]}
but that doesn't seem to work at all.
Am I missing something obvious?
<aside>
mathPLUS is not really written like that, but if I try to write it correctly, Joomla seems to 'eat' the plus sign, so where you see mathPLUS just imagine that it's math followed by a plus sign!
</aside>
For several months I've been using:
{mathPLUS -[actual_th0_temp_c] [actual_t8_temp_c]}
Last night I noticed that the calculation was failing. The problem seemed to be that actual_th0_temp_c was negative.
Today I tried to get around that by replacing the simple negative prefix with a nested math*, i.e.:
{mathPLUS {math* -1.0 [actual_th0_temp_c]} [actual_t8_temp_c]}
but that doesn't seem to work at all.
Am I missing something obvious?