import mir.appender; auto w = scopedBuffer!char; w.printZeroPad(-123, 5); w.put(' '); w.printZeroPad(123, 5); assert(w.data == "-0123 00123");
See Implementation