Rounding a double just 2 number after the comma

Karim Belhadj December 26, 2018
Hello team

Îm using script runner to calculate a field so I would like to get just 2 number after the comma , why should I import as class and how do it .


Regards

1 answer

1 vote
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 26, 2018

Here is code example:

import java.text.DecimalFormat

DecimalFormat twoCommaFormat = new DecimalFormat("###,###,###,###.##")

return twoCommaFormat.format(122333554.454131654567444)

Suggest an answer

Log in or Sign up to answer