robotframework中保留两位小数

其实很简单,使用evaluate执行python语句中的round即可,当然,也可以使用float

float('%.2f' % b)

    ${计算金额}    evaluate    ${兑换前金额}-${兑换后金额}
    ${计算金额}    convert to number    ${计算金额}
    ${计算金额}    evaluate    round(${计算金额},2)

猜你喜欢

转载自blog.csdn.net/DaxiaLeeSuper/article/details/80241098
今日推荐