swprabhu
6 years agoOccasional Contributor
How to remove trailing zeroes
I have to match two responses. One gives response say A like 113.00 and the other say B as 113 . I want to remove the trailing zeroes from A. How do I do it
I am reading the field value of A as below
def gainLoss =slurpRest.getRealizedByAccountResponse.securityList.e[b].GainLossList.RealizedGainLoss.text()
I tried using the below but get an error
def gainlossbig = new BigDecimal(gainLoss).setScale(0)
but get the error as 'Error in assertion script :null'
Please tell how do I remove the trailing zeroes in this case?