Hi All,
I have to apply character limit on text field like it will only show 5 digits after decimal and before decimal "n " number
ex. if we enter 1234.123456789 , it will show and store only 1234.1234567
thanks in advance
Discussion posts and replies are publicly visible
What is the reason to not use the floatingPointField? You could use the round() function to modify the value on save.
as per requirement we have to use it in text field only
That's not a real reason, but here is a example that you should adapt to your exact needs.
a!localVariables( local!value, { a!textField( label: "Decimal", value: local!value, saveInto: a!save( target: local!value, value: text(round(todecimal(save!value), 5), "#.#####") ), ) } )
Thanks Stefan
but its works up to certain limits like if I enter 14 digits before decimal then its not working, values after decimal are changing.
You did not mention the range of digits you need. You will have to adapt line 9 to fit your actual requirements.