XQuery: format-number: using $decimal-format-name is really, really weird

Can you imagine, that the 3rd argument needs extra double quotes around? And it’s not easy to find an example showing this, but here I found one:

declare decimal-format local:de decimal-separator = "," grouping-separator = ".";
declare decimal-format local:en decimal-separator = "." grouping-separator = ",";
let $numbers := (1234.567, 789, 1234567.765)
for $i in $numbers
return (
 format-number($i,"#.###,##","local:de"),
 format-number($i,"#,###.##","local:en")
)

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.