Temperature With Sign
medium
Shows a temperature with its sign and one decimal place, -12.5 as '-12.5' and -0.5 as '-0.5'.
What it teaches
DTOS writes the minus sign itself: -0.5 is -5 in tenths, DTOS gives '-5', and a point before its last digit makes '-.5'. Rounding can take the sign away too: -0.04 is 0 tenths, so it shows '0.0', not '-0.0'. The rest is the method from Weight With One Decimal: whole tenths, a 0 before the point below 1, and the point put back as text.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Temp | Input | REAL | -12.5 | The temperature in °C, -99.9 to 999.9 |
| Ref_Text | InOut | STRING | — | The temperature as the display shows it |
Required behavior
- Every scan, Ref_Text is In_Temp rounded to one decimal place, written with a point and one digit after it: 21.4 is '21.4' and -12.5 is '-12.5'.
- A temperature between -1 and 1 has a 0 before the point, and a negative one keeps its sign in front: 0.5 is '0.5' and -0.5 is '-0.5'.
- Zero has no sign, even when it is a negative temperature rounded to zero: -0.04 is '0.0'.
- In_Temp is always -99.9 to 999.9.
- With the default In_Temp of -12.5, Ref_Text is '-12.5'.