In "{n:05}", the leading 0 pads a number with zeros. Zero-padding text isn't meaningful,
so it's rejected for non-numbers; pad with spaces instead.
Wrong#
fn code(s: str): str = "{s:05}"Fixed#
fn code(s: str): str = "{s:>5}"Common causes#
- Formatting a number that's stored in a
str: parse it first, or pad with spaces. {x:05}on a value that only looks numeric.