Decimal Precision Error

Hi,

I want to set the float data precision to 2 digits. I tried with the below expression:

math.round(src_column,2) but its throwing below error. Could you please look into it?

ERROR: The expression result type FLOAT must be convertible to expected type BOOLEAN.

Thanks
kc

Hi kc,

It sounds like the expression you are entering is against a column that has the data type of Boolean.

Are you able to post an image or example?

Thanks
Danny

image

image

My source column is type FLOAT, while debugging it returns correct, but surprisingly writing the expression is incorrect.
FYI, I’m writing the expression in Profiler’s Business rule tab.

Business Rule expects to receive boolean result ‘True’ or ‘False’.

So you should rewrite your expression to return a boolean result. Something like the following:

math.round(ANP, 2) = ANP

Hey Alex,
Thanks a lot for resolution. In addition to it could you please let me know how can I remove the time portion from datetime field ? I just need to convert datetime to date.
ex: dd-MM-yyyy HH:MM:SS to dd-MM-yyyy.
Note: This has to be done in setting up business rule within Profiler.

Thanks again.

You can use toDate function

Hey Alex,

could you share an example because toDate() is not working for me?
I tried to debug the expression to, every time Null value is coming as output.