cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Display decimal values only when needed

jrumpza
7-Bedrock

Display decimal values only when needed

Does anyone know if it is possible to format a number value in a grid such that whole numbers will be displayed as integers and decimals will be displayed as decimals? We have a use case in which almost all numbers are whole numbers, but every once in a while a decimal value is needed. In order to improve the readability of the UI, we would like to be able to show those decimal values accurately without requiring all whole numbers to be displayed with unnecessary digits, such as "5.000".

ACCEPTED SOLUTION

Accepted Solutions

Hello @jrumpza 

 

Go to Configure Grid Column >Column renderer and state formatting and uncheck rounding enabled .You will be able to achieve your use case.

You can also refer the following post 

https://community.ptc.com/t5/ThingWorx-Developers/Format-number-without-meaningful-trailing-zeros-in-Advanced-Grid/td-p/637280

 

If your issue is resolved please mark it as the Accepted Solution for the benefit of others in the community.

View solution in original post

4 REPLIES 4

Hello @jrumpza 

 

Go to Configure Grid Column >Column renderer and state formatting and uncheck rounding enabled .You will be able to achieve your use case.

You can also refer the following post 

https://community.ptc.com/t5/ThingWorx-Developers/Format-number-without-meaningful-trailing-zeros-in-Advanced-Grid/td-p/637280

 

If your issue is resolved please mark it as the Accepted Solution for the benefit of others in the community.

jrumpza
7-Bedrock
(To:odukiya)

Thank you! Yes, that did the trick. I had tried that earlier, but on a Value Display, where it does not work. But it does work for the grid, which is more important for my use case.

 

If there is also a separate solution that does the same trick for a Value Display as well, that would be great too.

Hello @jrumpza 

 

Value Display has a renderer that you can configure. Have you tried that?

 

Thanks

Om Dukiya

jrumpza
7-Bedrock
(To:odukiya)

I have - I set it up the same way as it is set up in the grid, but in the case of the Value Display, it always shows the decimal values, so instead of "5" it shows "5.000". Perhaps it is a bug. At least the formatting for the grid values works

Announcements


Top Tags