I am working on a GET Request where it should suppose to return the one of key value in the response as 400000000000.00 but in karate framework the key value is being displaying in exponential format as 4E+11 in response.
But when executing the same request using postman, its showing the value in response as expected in number format
I have tried by going through the document but dont find any required details. The smaller numbers displayed in number format and observed the issue only for the bigger numbers like 12 digits as per my observation
Since the conversion happening in response details automatically
Expected response from karate: {"balanceAmount" : 400000000000.00}
But the Karate framework returning response as {"balanceAmount" : 4E+11}
Karate parses data into Java primitives and 99.9% of the time, this works fine.
As someone mentioned in the comments, when you need to produce large numbers, you can use the
BigDecimalclass: https://github.com/karatelabs/karate#large-numbersAnother way to send a request with the exact numbers you want is to use a string, and make sure your
Content-Typeheader is set correctly. For example:You can try this yourself, and note how Karate will
matchcorrectly and handle even large numbers.Another tip is that Karate always stores the response as bytes, and it will be available as
responseBytes. Converting this to a string will allow you to see the "actual" response.