SPLat Logo

OBLCD_fDispW f,p

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

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

WfpDisplayComments
1.23456 5 3

1.235

Note rounding
-1.23456 5 3

-1.23

Limited by f character positions
-1.23456 9 3

^^^-1.235

Limited by 3 decimal places
12.3456 5 3

12.35

 
123.456 5 3

123.4

 
1234.56 5 3

^1235

Decimal point suppressed
12345.6 5 3

12346

 
123456 5 3

+++++

Overflow: result can't fit in field
-12345.6 5 3

-----

Underflow (negative overflow)
0.123456 5 3

0.123

Leading "0." is displayed

-0.123456 5 3

-0.12

 
-0.00012345 5 3

-0.000

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).