162 views
in Embedded Wizard Studio by
Hello team,

I am trying to display a float value using the value display widget. My input is a string and I converted it to a float value using the parse_float( -1.0 ) function.

eg: var float r1 = s1.parse_float( -1.0 ); // r1 = 41.5

I am receiving r1 correctly as 41.5. However when I am trying to display it on the screen using value display widget, i am getting only 41.0

The precision field in the value display is set to 1, still it does not work. Can you please let me know what I must do in order to get it correctly?

 

Best Regards

1 Answer

0 votes
by

Hello,

please note, that the Value Display is using Int32 values and shows them (if required) in a fix point notation. The interface of this widget does not take float values. I assume you get a corresponding warning.

For more information about the widget see the section Determine the Value Display's content.

In your case, if you want to show your value with a precision of 1 (means one digit after the decimal sign) you should multiply your float value with 10.0 and convert it to Int32.

Does this work?

Best regards,

Manfred.

 

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...