Data Grid 1, when showing decimal value, how to not show the tail .00 when the number is interger?

0
Data Grid 1, when showing decimal value, how to not show the tail .00 when the number is integer? i.e. when the number has decimal fraction, show .xx precision. When the number is integer, not show the .xx precision    
asked
3 answers
3

You can use the formatDecimal function. Try this…

 

formatDecimal($material/quantity, '#,##0.00')

Behind the scenes this is using the Java DecimalFormat, so you can find more details on the characters you can use in that documentation.

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/DecimalFormat.html

Good luck!

answered
0

Hi!

You will have to manipulate this in a microflow, where you can check if the number has .00 at the end then round it off and save that value, otherwise display the decimal number

answered
0

Hi Yin

In your datamodel, you can alter the precision. Furthermore, in the documentation you’ll find that you can alter the output via functions: https://docs.mendix.com/refguide/parse-and-format-decimal-function-calls/

Kind regards,

Leander

answered