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

##### Share on other sites

• MVP 2023

You actually do Num->ASCII first.

Post the PLC program containing what you've tried so we can get an idea of where you're starting and the magnitude of the floating point numbers.

Joe T.

##### Share on other sites

Hi,

my program is used to convert bits to decimal based on the linear curve (0 - 1023) bits and display it in a numeric variable.

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

##### Share on other sites

Thank you very much, Sir, you have helped me a lot, just one thing I want to understand the logic of the positioning of the point, for example, if I want to display X, XX or XX, X how this logic works

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

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

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.

×
×

• Leaderboard
• #### Support

×
• Create New...