numberFormat() not display decimals

I’m in Ignition 8.1.12.
Expression below not works I don’t know why. Result must be 13.8.

try toFloat() instead.

No changes. Result still 13 instead of 13.8

Maybe round is what you are after,

I think you’ve got the right function, just the wrong format string. Try #,##0.0, e.g.
2021-12-09 at 9.47 AM

Reference: Data Type Formatting Reference - Number Format

1 Like

With “#,##0.0” result is 13.0.


It works in python script. Is there a solution in python to do same format like “#,##0.##” ?

What if you just return {value} ?

What are the settings under Project->Project Properties and Perspective->General? Do you have a Project Locale specified?

You could use


What is exactly the output format you want ?

Project Locale is Browser.

With just {value} output is the same as input var type is string.

I’m confused. Does the bare numberFormat({value}) (without toFloat) not work for you?
What’s the actual type of this value (try the typeOf expression function)? It sure looks like a floating point to start.

Wait, what ?
Is your input property a string, or is the output a string ?

input is a string,
and the result is displayed in a label text so output should be a string.

Did you try a Format transform?

Same problem. :sob:

Can you try doing it on another input and see if you get the same results ?
Maybe make a custom prop and bind it to toString(13.81235124), then try applying the same process to this one.

Is numberFormat supposed to obey the locale? Yours appears to have put a , in instead of a . but I can’t get it to do that for me like the Format Transform can. Unfortunately with the Format Transform I can’t have dynamically set significant figures.