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
I agree with fixed() only, and I would place the 'conversion' on the saveInto vs the display, try:
EDIT: Code updated
a!floatingPointField( label: "Test", value: ri!value, saveInto: a!save( ri!value, if( rule!APN_isEmpty(save!value), 0.00, todecimal(fixed(save!value,2)) ) ) )
You are aware that fixed() returns a string and you are back into an auto type conversion cycle?
Yes, but I haven't ran into any issues using fn!fixed (without fn!trunc), and I use it in a number of locations within a Purchase Request/Order application and elsewhere.
Try to use fixed(ri!value,2) instead of todecimal(fixed(trunc(ri!value, 2))) under value config.
This is not keeping up to two decimal places.
Already tried, but this rounds off to next integer value, which is not the expectation here. Like:
If we don't want rounding, the combination of only fixed() and trunc() should do this for you:
a!floatingPointField( label: "Test", value: ri!value, saveInto: a!save( ri!value, if( rule!APN_isEmpty(save!value), 0.00, fixed(trunc(save!value,2),2) ) ) )