1 year ago

#77511

test-img

Trung Le

How to parse from string to Int without .0 in Karate

I following the document of Karate Framework, to parse string to Int https://github.com/karatelabs/karate#floats-and-integers

  • def foo = '10'

  • string json = { bar: '#(1 * foo)' }

  • match json == '{"bar":10.0}'

  • string json = { bar: '#(parseInt(foo))' }

  • match json == '{"bar":10.0}'

But in my case, I need to got a number without .0 such as '{"bar":10}' in above sample

string

parsing

integer

karate

0 Answers

Your Answer

Accepted video resources