Skip to content

padId

The padId function converts a number to a string and pads it with leading zeros to reach the specified number of digits.

{number | padId:digits}
  • input (number): The number to pad
  • digits (number): The total number of digits desired

A string with the number padded with leading zeros

{5 | padId:3}
// Returns: "005"
{123 | padId:3}
// Returns: "123"
{42 | padId:6}
// Returns: "000042"
{"VULN-" | append:{vulnerability.id | padId:4}}
// Returns: "VULN-0023" (if id is 23)
{index | padId:2}
// Returns: "01", "02", "03", etc.
  • Creating uniform ID formats
  • Generating invoice or ticket numbers
  • Formatting sequential identifiers
  • Building sortable reference codes
  • Standardizing numerical displays in reports