class Test def main d as decimal = 1.57 assert d.rjust(5, 'N1') == ' 1.6' f as float = 1.57f assert f.rjust(6, 'N1') == ' 1.6' extend Object def rjust(width as int, format as String) as String obj = this to dynamic return obj.toString(format).padLeft(width) # .toString is defined by Object, but subclasses may overload it