Question
Ciberspring Inc
IN
Last activity: 28 Jun 2024 0:29 EDT
Remove Trailing 0 after decimal
Using a decimal property to store the required value.
When user tries to update the value, there are lot of trailing zeroes after decimal point which are useless.
Is there any way to remove the trailing zeroes without rounding or changing the value.
Eg.,
3.256555 should stay as it is.
3.0000000000 should appear as 3 or even 3.00 is fine.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Ciberspring Inc
IN
Thank you all.
I added a step to set the value as below, before loading the section, and that worked
@pxReplaceAllViaRegex(.TRMWeight,"0*$","")
Maantic Inc
IN
You can use @RemoveTrailingZeros() function.
Ciberspring Inc
IN
I do not see any such function. Pega version 8.6.6
Also, this may not help as the property is decimal.
Zeroes are added after the property is set.
Maantic Inc
IN
I tried in version 8.8. It works in decimal. PFA
Ciberspring Inc
IN
The problem is when that decimal property is displayed on UI.
At the time of property-set, i have clean value.
Maantic Inc
IN
In the presentation tab of the section element, you can configure till how many decimal places you want to display. You can also achieve this using edit input.
Updated: 3 May 2024 10:56 EDT
Pegasystems Inc.
CA
I hope you can configure the decimal digits to be 2 on the presentation tab.
Also, Edit Input on the Property will also help you...
Accepted Solution
Ciberspring Inc
IN
Thank you all.
I added a step to set the value as below, before loading the section, and that worked
@pxReplaceAllViaRegex(.TRMWeight,"0*$","")
Ciberspring Inc
IN
in defer load activity of the layout
ANZ operations and technology
IN
@NisargK0 we have the trailing zeros in the fields inside the table (not dynamic layout) where can this function be called from our table configurations