Decimal value of decimal to 0E-8

1
Hi, I have a form with an object with a Decimal type field. I notice a case where my decimal value is set to “0E-8” and is not passing my check  “ < 0 ” ,  in fact neither  “ < 1”, and behave like is bigger How can I managed it?  I mean 0E-8 is inferior to 1 for sure and I can’t use “0E-8” in the conditional check. I only found a question on this forum from 2 years ago but nothing in Mendix documentation. 
asked
2 answers
2

Hello Matthieu,

0E-8 is a translation of 0 with 8 decimal places. I assume you’re getting this by calling toString() on a decimal.   

If you would be comparing the actual decimal attribute to your value the result should correctly indicate your decimal is 0.

if you’re converting your decimal in a microflow, try using formatDecimal instead, if the conversion happens somehow on an input field I would check the properties of that field and force it to display 0.00000000 instead.

Hope this helps. 

answered
0

Hello Dragos,

Thanks for you support, I’m not calling any toString(), in fact is what I see in the variable tab in debug mode :


And my check in the microflow is as simple as something like:

DecimalField < 0.1


I will try a workaround with your comments but seems weird for me as I’m processing decimals values directly and not strings

answered