Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Float suppress zero

vincentger
2023-01-11
2023-01-13
  • vincentger - 2023-01-11

    Hey everyone -

    Is there a way to suppress zeros in a float display. I am currently using %3.1f to display the float but i dont want it to show a zero as a decimal.

     
  • TimvH

    TimvH - 2023-01-13

    Probably you have to write some code to convert it to a string, find the dot, then remove everything behind the dot if the next character is a zero.

    If you create a function for this, you can reuse this code for all REAL variables which you want to show like this.

     

Log in to post a comment.