Question

3
Replies
11336
Views
VenkateshKumarR6041 Member since 2015 18 posts
BNY Mellon
Posted: 3 years ago
Last activity: 3 years 1 month ago
Closed
Solved

Truncating Decimal places without doing a rounding off

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. As this is an amount field the rounding off is not required. Please let us know how we can achieve this.

User Interface
Moderation Team has archived post
Share this page LinkedIn