• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 96
  • Last Modified:

XPath and XQuery: xs:decimal as a function

In my particular tool I can not use format-number.  

I have seen references to xs:deciaml used as a function, and it apparently is offered by my tool

Assuming I want the equivalent of the following:

format-number(123, '0.009')

Open in new window

How would I do this with xs:deciaml ?

Anthony Lucia
Anthony Lucia
1 Solution
Geert BormansInformation ArchitectCommented:
explain why you can't use format-number()
read: tell us more about your environment

xs:decimal casts a number to decimal if possible, but it is XPath 2.0 functionality
- only works as a function in environments that also support format-number()
- does not format!, only casts

It could be that you are using some obscure subset of XQuery that does not serialize... then you need to take serialization outside the tool
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now