cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi, 

I have a requirement where in JSON value need to be send as integer instead of string.

Method in groovy script is: 

def json = message.getBody(java.lang.String)
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText(json)object.issuer.branchCode = object.issuer.branchCode.toDouble().intValue();

Value is branchCode: "0732340"

Output of above groovy is branchCode: 732340

Expected output is : branchCode: 0732340

Please help with changes that can be done in the code or any alternate code which can be used.

Thanks & Regards,

Mayank

 

 

 

 

 

 

 

0 Likes
View Entire Topic
sachin_yadav3
Active Participant
0 Likes

Hi , 

Try by defining object as integer i.e.  int object = 

Thanks