How to transform a decimal to a string with on two numbers after the dot e.g 1.00

1
I have an entity Prices with the a decimal attribute Value.    I'm trying to transform it into a a string using toString($Prices/Value) but I'm getting the value 1.00000000. When I tried to use  toString(substring($Prices/Value, 2)) it's giving me an error.    How can I get it to show only 1.00?  
asked
2 answers
4

Indeed use formatDecimal:

formatDecimal($Prices/Value, '#,##0.00')

 

answered
2

Hi Enzel,

Can you use 'formatDecimal' instead of tostring and substring?  I think this can work for you

https://docs.mendix.com/refguide/parse-and-format-decimal-function-calls/

Good luck!

Cheers, Mark

answered