trailing 0s

Hi all,

Another question for you. hope this is easy.

I have numeric data that sometimes is .001. However, for standard purposes, i would like to show it as .00100 (out to 5 digits). I know to do that in layout view, just change the format to 0.00000 .

but… is there a way to programmatically how many digits to display the format to? For some data on the same field, i would need to show 4 digits or 3.

sometimes .001, sometimes .0010

thanks.
sammy

Hi Sammy,

In a method you can format numbers with the utils.numberFormat function.```
utils.numberFormat(Object number, Object fractions/format)

You find it under the Utils node in the Servoy editor.

Hope this helps.