Hi,
Whenever I'm trying to enter 271.64 or 2**.65 where (** can be any number) it's getting converted to 2**.64
I'm using below expression for this:
a!floatingPointField( label: "Test Decimal Value", value: todecimal(fixed(trunc(ri!value, 2))), saveInto: ri!value)
Not sure, if this is an issue from Appian. Can anyone confirm this.
Thanks in advance.
Discussion posts and replies are publicly visible
Fascinating bug you found there.
From my testing, the issue seems to be with the trunc() function, fixed() does not exhibit the same behavior.
I recommend reducing your expression to: fixed(ri!value, 2)
It is not necessary to use todecimal(), as the a!floatingPointField() performs the cast as well.
So, right now, you are truncating as a floating point number, converting to a string, and setting a fixed number of characters, then converting BACK to a floating point number, for a field than then casts to a floating point number automatically. A few more steps than necessary, I should think.
Take care,
JM
Already tried, but this rounds off to next integer value, which is not the expectation here. Like:
I can imagine you are frustrated, and under some stress.
However, I think you should take a breath and calm down, then re-read the advice you have received, because you have not actually followed it.