cancel
Showing results for 
Search instead for 
Did you mean: 

formatting amount to 2 decimal places without rounding the value

Former Member
0 Kudos

Hi

My requirement is to format the amount field, when I am using the simple type and setting the format as ###,##0.00 then it is rounding off the value. Foe example say the amount is 3,567.236 in this case it rounds it off to 3,567.24 which I do not want we want the value to display as 3,567.23. Does anyone have any idea how this can be achieved.

Thank you

Regards,

Preet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Use the following :

BigDecimal bigDecimalh = new BigDecimal("22.335642");

bigDecimalh = bigDecimalh.setScale(2, BigDecimal.ROUND_DOWN);

Regards,

Himanshu