[英]How to convert decimal to integer in xpath?
The input xml includes the following element: 输入xml包含以下元素:
<numberOfPayments>14.0</numberOfPayments>
I need to convert the number to integer, with following limitations: 我需要将数字转换为整数,但有以下限制:
You can use round()
. 你可以使用round()
。 The xpath query would be: xpath查询将是:
round(/numberOfPayments/text())
or if you are only interested in the integer part without rounding you can use floor()
: 或者如果您只对整数部分感兴趣而不进行舍入,则可以使用floor()
:
floor(/numberOfPayments/text())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.