Numeric calculations

[Example 39] <C>

Functions number transforms its argument into a number. This stylesheet demonstrates string conversion, This stylesheet conversion of boolean values true and false.

[Example 36] <C>

Addition, subtraction and multiplication uses common syntax (This stylesheet). Division syntax is less usual. Slash / is used in patterns and so keyword div is used instead (This stylesheet).Operator mod returns the remainder from a truncating division. (This stylesheet)

[Example 37] <C>

Function sum() sums all numbers in selected nodes. This stylesheet sums all numbers, This stylesheet only odd ones.

[Example 38] <C>

Functions ceilng(), floor() and round() transform floating point numbers into integers in the specified way.

[Example 44] <C>

Function string() transforms its argument into string. This function is not usualy directly used in stylesheets as it is in most cases called by default. This stylesheet shows examples of number to string conversions. Notice results of zero divisions.

[Example 84] <C>

Test, if element value is a number