1
0
Fork 0

David Culp:

One thing I maybe should add to the doc is that the order of operation is
always:

1.  scale (multiplication)
2.  offset (addition)
3.  truncate (truncation)

This will matter when, for instance, converting from Fahrenheit to Celsius.
The normal formula is C = (F - 32) * 0.55555556.   The operator precedence
above requires a new formula,  C = (F * 0.555555556) - 17.777777777.
This commit is contained in:
ehofman 2004-01-23 15:37:06 +00:00
parent f8c23e13c3
commit 3176a4676d

View file

@ -580,7 +580,10 @@ This example is a switch that contains both static and dynamic text:
</pre>
<br>
Note that the value to be displayed can be modified using &lt;scale&gt; for multiplication,
&lt;offset&gt; for addition, and &lt;truncate&gt;true&lt;/truncate&gt; for truncation.
&lt;offset&gt; for addition, and &lt;truncate&gt;true&lt;/truncate&gt; for truncation. The order of
operation is always scale-offset-truncation, which may require you to adapt your formula. For instance, the
normal conversion from Fahrenheit to Celsius would be C = (F-32)*0.555555556. Because of the order
of operation above you must use the formula C = (F*0.55555556)-17.77777777.
<br>
<HR WIDTH="20%">