XPath and XQuery Functions and Operators 3.0: Formatting integers and numbers

I need to pad a decimal number to a given length with leading white space. Looks like there is nothing in the “built-in library”. Looks like there is no functx:pad-integer-to-length as well, but functx:pad-string-to-length looks intriguing – but it only pads on the right. I created a variant, that pads on the left: pad-string-to-length-on-the-left.xqy – pls follow the link shown above!


Comments

Leave a Reply

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