Question
Veteran Careers First
US
Last activity: 7 Sep 2018 11:39 EDT
round decimals
I have a requirement to round decimals
Ex.
- If decimal less than 50 (ex. 19.20) then round to 19
- If decimal greater than 50 (ex. 19.60) then round to 20
Any ideas
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Tekclan solutions
IN
There is OOTB function in pega @round(.Property). Use this in data transform to set the property value and configure event action for the property.Set Event as click and Action as Refresh then specify the created data transform into it.On Execution when the value is entered and click action is performed it gives the round of value.
Pegasystems Inc.
IN
do review similar posts here
https://collaborate.pega.com/question/decimal-precision-editable-format
https://collaborate.pega.com/discussion/how-round-value-decimal-property-certain-precision-point
-
Praveen Kota
Vodafone
IN
Hello Henry,
We don't have Pega OOTB feature to fix reported issue, as an alternative you can achieve this in using custom Java logic .
1. onChange of property value call an activity, fetch the property value (this.value) and use Math.round logic in activity java step.
-
Cheuk Yi Mak
CollabPartnerz
IN
Hi,
Below link might help you.
https://collaborate.pega.com/question/decimal-precision-editable-format
PEG
GB
If it's a pure Java step
(D + .5) % 1
Accepted Solution
Tekclan solutions
IN
There is OOTB function in pega @round(.Property). Use this in data transform to set the property value and configure event action for the property.Set Event as click and Action as Refresh then specify the created data transform into it.On Execution when the value is entered and click action is performed it gives the round of value.
-
Josué Menjivar
CollabPartnerz
IN
You can use Math.round logic method inside an activity to set.
CollabPartnerz
IN
Have you tried with math.round functions.
Pegasystems Inc.
US
You can also use the Edit Input Rule to do the same.
java.text.DecimalFormat f = new java.text.DecimalFormat("##");
theValue=f.format(d);
Veteran Careers First
US
Can you provide steps on how to implement