验证空手道框架中的浮点值范围 [英] Validate the float value range in karate framework
本文介绍了验证空手道框架中的浮点值范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的情况是检查某个字段是否接受范围为0.01到25000的范围.它可以是十进制值.在空手道框架中执行此操作的方法是什么..我在正则表达式下面使用了不正确的
My scenario is to check whether a field accepts range from 0.01 to 25000 .. it can be decimal value . What is way to do it in karate framework.. I used below regex which is not correct
推荐答案
只需乘以1即可将字符串转换为数字
Just multiply by 1 to convert a string to a number
* def foo = '0.2'
* assert (foo * 1) < 0.3
也请阅读: https://github.com/intuit/karate#type-conversion
这篇关于验证空手道框架中的浮点值范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文