Question
Cathay
CN
Last activity: 16 Oct 2024 1:35 EDT
Truncating Decimal places
We have a requirement where we have to limit the no of decimal places to 2. When the user enters the value in any amount fields, the entered value should be formatted in the proper decimal format as below.
1. If entered 12345 change it to 12345.00
2. If entered 12345.234 change it to 12345.23
3. If entered 12345.235 change it to 12345.23
We are using the Decimal control in which we have mentioned the Precision as 2 and we are refreshing the screen on change. When the user enters the value and Tab out, the first two scenarios works fine. But the third scenario is doing a round off and changes the value to 12345.24.
Also, if this field gets the cursor back, you'll see the original 12345.235. We just want to see the truncated numbers.
As this is an amount field the rounding off is not required. Please let us know how we can achieve this.
***Edited by Moderator Rupashree to add Capability tags***