Normalizes a postal code into a 5-digit string (e.g. 100 -> '00100').
Postal code as text or an integer. Shorter codes are padded to five digits.
The five-digit code, or null if the input is not one to five digits.
null
normalizePostalCode(100); // '00100'normalizePostalCode('20000'); // '20000'normalizePostalCode('2000A'); // null Copy
normalizePostalCode(100); // '00100'normalizePostalCode('20000'); // '20000'normalizePostalCode('2000A'); // null
Normalizes a postal code into a 5-digit string (e.g. 100 -> '00100').