Leadingzeros feature in XSLT

We have any function for leadzeros.

+6
source share
1 answer

Use format-number(12345, "0000000000") .

This obviously only works for numbers, and can only process zeros, but you can use any character using the following substring:

concat(substring('0000000000',string-length($val)),$val)

This can be useful when filling in with .... or spaces, for example, or if your value is not numeric.

+9
source

Source: https://habr.com/ru/post/897199/


All Articles