Am 6. Dezember 2018 10:36:00 MEZ schrieb "贾国动" 
<[email protected]>:
>Sorry, I found the attached screenshot could not be displayed.
>
> 
>
>---response
>
>{"moduleId":25,"dimensionInfoList":[{"dimensionId":"vip","dimensionName":"会员价","adjustPrice":0.00},{"dimensionId":"net_sale","dimensionName":"网售价","adjustPrice":6.55},{"dimensionId":"student","dimensionName":"学生价","adjustPrice":-1.00},{"dimensionId":"adult","dimensionName":"成人价","adjustPrice":5.50}]}
>
> 
>
>---jsonpath
>
>$.dimensionInfoList..adjustPrice
>
> 
>
>--result
>
>Result[0]=0.0
>
>Result[1]=6.55
>
>Result[2]=-1.0
>
>Result[3]=5.5
>
> 
>
>I don't know why the“0” at the end is missing, then my assertion will
>failed.

The values will be considered to be floats and represented as strings. Zeroes 
at the end of the fraction will be removed by that process. 

You would either have to re-format the number (string really) or use the 
shortened string for your assertion. 

Regards, 
 Felix 

>
> 
>
> 
>
> 
>
>发件人: 贾国动 <[email protected]>
>答复: JMeter Users List <[email protected]>
>日期: 2018年12月6日 星期四 17:18
>收件人: <[email protected]>
>主题: Jsonpath loses its last zero
>
> 
>
>I'm trying to get the data using jsonpath from the http response, but
>it doesn't seem to work very well, does anybody know why.
>
>my JMeter: Apache JMeter Version 4.0 r1823414
>
> 
>
> 
>
>Thanks a lot~
>
> 
>
> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected] For
>additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to