Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to round a custom field value of type "double" to 3 decimal places in script listeners

SWAPNIL SRIVASTAV
Contributor
June 8, 2020

How to round a custom field value of type "double" to 3 decimal places in script listeners

1 answer

1 accepted

0 votes
Answer accepted
Nir Haimov
Community Champion
June 8, 2020

what type is the custom field?

basically is to should be something like:

def myNum = 7894.12356

def myCfVal = new DecimalFormat("##.###").format(myNum) // will set 7894.123
SWAPNIL SRIVASTAV
Contributor
June 8, 2020

Hi @Nir Haimov ,

It worked. Thanks

Suggest an answer

Log in or Sign up to answer