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.