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
Request clarification before answering.
Hi ,
Try by defining object as integer i.e. int object =
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.