.. _functx_pad-integer-to-length: ============================ functx:pad-integer-to-length ============================ Pads an integer to a desired length by adding leading zeros Description ~~~~~~~~~~~ The functx:pad-integer-to-length function returns $integerToPad concatenated with enough leading zeros to make its length $length. The function will raise an error if $integerToPad is longer than $length. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - integerToPad:integer() - the integer to pad * - length:integer() - the desired length Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:pad-integer-to-length(12,6) - 000012 * - functx:pad-integer-to-length(1, 6) - 000001 * - functx:pad-integer-to-length(12, 2) - 12 Depends On ~~~~~~~~~~ * :ref:`functx_repeat-string`. See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_pad-string-to-length`. * :ref:`functx_repeat-string`.