OK... this has very weak support for the %f
format specification, but it works:
module IO.Printf
toOctal : Int -> String
toOctal n = let (q, r) = (div n 8, mod n 8) in
case q == 0 of
True => show r
False => toOctal q ++ show r