
vec:trunc( $vector as vec:vector, [$n as xs:integer?] ) as vec:vector
Returns a new vector which is a copy of the input vector with each element truncated to a specific number of digits.
xquery version "1.0-ml"; let $vec := vec:vector((1.234,2.654)) return vec:trunc($vec, 2) => [ 1.23, 2.65 ]
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.