I want to read an Unsigned value and display it as a decimal number

Modified on Fri, 17 Jun, 2016 at 9:24 AM

Float values should be displayed as decimal values, however it is possible to show an UNSIGNED variable as a decimal in the DD.


For example: read the value 1800 display as 18.0: 

 

VARIABLE my_variable

{

  LABEL "Input";

  CLASS DEVICE & DYNAMIC;

  HANDLING READ;

  TYPE UNSIGNED_INTEGER (2)

  {

    DISPLAY_FORMAT ".1f";

    SCALING_FACTOR 0.01;

  }

}


TOK 8.1.32 will issue a warning for this (WARNING 622: Invalid Conversion Character 'f'in display format string for variable).

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article