Jump to content

Display a float number with a precision of digits after the decimal point


Recommended Posts

Hello,
it's my first time working with Visilogic and I do not know how to display a float number with a precision of 2 digits after the decimal point. I have already found that this question has been asked by someone else who has been advised to use ASCII to Num, I tried to do it but I did not get there. can you help me, please ? and thank you in advance

Link to comment
Share on other sites

  • MVP 2023

You're certainly going about this the hard way. Use a linearization function block to linearize MI 11  to 0-100, placing the result in another MI. You can then show the voltage to one decimal place using an HMI numeric display. If you want two decimal places, linearize from 0-1000 instead of 0-100. There is no need to use an MF here.

image.png.68ca5d6f5efad26054b6bda4d72187a7.png

image.png.87e31d7328b5e28540dfb831351d924a.png

  • Like 1
Link to comment
Share on other sites

  • MVP 2023

Displaying an integer on screen uses "implied decimals". Near the middle of the Numeric Variable above you'll see a setting for the number of decimal places. In the picture above you'll see 2.1 (look just to the right of "Base Format:"). If you want to display a 3 digit number with 2 decimal places, you would use 3.2. The number 26451 would be displayed as 264.51. By doing your linearization from 0-100 for the 0-10 volt analog input, you don't have to multiply by 10 to get one decimal place of precision.

Feel free to ask more questions, if needed.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.