Setting Multiple Formats

Hi, I have the following situation.

I have a field used to set a discount.
Therefore I set the format of the field as #%

Now the problem is that sometimes I need to set a float discount (ex: 2,5%).
The current format wasn’t useful anymore because it rounded the float to 3%.

So I changed to #.0%
But that implies that if I use a round number it appears as 1,0% instead of just 1%

Is there a way in wich I can use multiple formats and select them depending on what is the format of the value whitout using a converter method?

I’ve tried #.0%||#% but it’s not working and I’m not sure it’s correct.
What I’m sure is that Servoy allows this kind of format as there is no warning about it. :?

Thanks for the help :D

i think the only way is to toggle the format in onrecord selection method.
So that you test what you want to show and call setFormat() on it.

Ok,
If that is the only way…
I’ll have to get my hands dirty.

Thanks for the help :D