I would like to ask if there's a way to parse a version number using a groovy script.
I extract from Ariba a payload, the issue comes with a specific field called ItemNumber
.
At first it was working, but this month I started to retrieve a version instead of a float.
This is the part of the script that needs to be changed, but I can't find a way to do it.
if (ItemNumber?.trim()){
list.ItemNumber = Double.parseDouble(ItemNumber.toString());
}
EDIT: This is the field I retrieve: { "ItemNumber": "4.4.5" }
.
I would like to get this: { "ItemNumber" : 4.4.5 }
.
Any help is greatly appreciated,
Thank you, Kostas