OBLCD_fDispW f,p
Displays the floating point number in W according to the format specifiers f and p.
f specifies the number of character positions that are to be used, including the decimal point itself. f must be between 1 and 9. Remember that the precision of the floating point numbers in SPLat is about 7 decimal digits. The number will be displayed right-justified in the field width you specify in f. Unused character positions will contain a space.
p specifies the maximum number of digits to be displayed after the decimal point.
The number is rounded in accordance with the number of digits displayed.
Note: This instruction modifies UV
Examples (spaces shown as ^):
W | f | p | Display | Comments |
---|---|---|---|---|
1.23456 | 5 | 3 |
| Note rounding |
-1.23456 | 5 | 3 |
| Limited by f character positions |
-1.23456 | 9 | 3 |
| Limited by 3 decimal places |
12.3456 | 5 | 3 |
| |
123.456 | 5 | 3 |
| |
1234.56 | 5 | 3 |
| Decimal point suppressed |
12345.6 | 5 | 3 |
| |
123456 | 5 | 3 |
| Overflow: result can't fit in field |
-12345.6 | 5 | 3 |
| Underflow (negative overflow) |
0.123456 | 5 | 3 |
| Leading " |
-0.123456 | 5 | 3 |
| |
-0.00012345 | 5 | 3 |
| Take care with small numbers! |
In SPLat applications you are unlikely to need to display very large or very small (close to 0) numbers. The numbers you display will usually be count values or some engineering units. You will presumably have a good idea of the expected range of values before you start, and will scale appropriately. For example, if your program totalizes the amount of cement packed you would scale your estimate to tons, not grams.
Dialect exclusions: Not available in dialects before 9. Also, not available on SPLat controllers that do not have onboard LCD support (please check the documentation for your specific board and Firmware version).