Check the "Suppress trailing 0's" box with python

Hi everyone,

I’m currently working on a graph that can modify some units Format and rounding increment depending on if the project is metric or imperial. That part is done, but i also want to check the “Suppress trailing 0’s” box and i haven’t found a solution yet… Here is the case i want to check:

And here is my graph:
Thanks for your help

The FormatOptions class has a SuppressTrailingZeroes property as shown here. In your case, this would just involve adding this line after you construct your FormatOptions:

format.SuppressTrailingZeros = True

You can find all of the available class methods and properties here.