Skip to main content

normalize_id

Function normalize_id 

Source
pub fn normalize_id(id: &str, width: usize) -> String
Expand description

Normalize an ID to a fixed width with zero-padding.

  • "5" with width 3 -> "005"
  • "005" with width 3 -> "005"
  • "0005" with width 3 -> "005" (strips leading zeros beyond width)