Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "fmt"
s := fmt.Sprintf("%03d", i)
s := format('%.3d',[i]);
s = "%03d" % i
let s = format!("{:03}", i);
import std.format : format;
string s = format("%03d", i);
s = format('03d', i)
$s = sprintf('%03d', $i);
String s = String.format("%03d", i);
my $s = sprintf '%03d', $i;
string s = string.Format("{0:000}",i);