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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...