Knowledge Base

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 ^):

WfpDisplayComments
1.23456531.235Note rounding
-1.2345653-1.23Limited by f character positions
-1.2345693^^^-1.235Limited by 3 decimal places
12.34565312.35 
123.45653123.4 
1234.5653^1235Decimal point suppressed
12345.65312346 
12345653+++++Overflow: result can’t fit in field
-12345.653-----Underflow (negative overflow)
0.123456530.123Leading “0.” is displayed
-0.12345653-0.12 
-0.0001234553-0.000Take 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).