Logo

Programming-Idioms

History of Idiom 156 > diff from v8 to v9

Edit summary for version 9 by Oldboy:
New Python implementation by user [Oldboy]

Version 8

2017-07-26, 00:20:30

Version 9

2017-10-28, 10:59:52

Idiom #156 Format integer with zero-padding

Assign to string s the value of integer i in 3 decimal digits. Pad with zeros if i < 100. Keep all digits if i1000.

Idiom #156 Format integer with zero-padding

Assign to string s the value of integer i in 3 decimal digits. Pad with zeros if i < 100. Keep all digits if i1000.

Extra Keywords
pad leading fixed width
Extra Keywords
pad leading fixed width
Code
s = format('03d', i)