View Problem

Format a decimal number

Format the number 7/8 as a decimal with 2 places: 0.88
DiskEdit
ocaml
Printf.printf "%4.2f" (7. /. 8.);;
DiskEdit
ocaml
let s = Printf.sprintf "%4.2f" (7. /. 8.) in
print_string s;;

Submit a new solution for ocaml
There are 29 other solutions in additional languages (clojure, cpp, csharp, erlang ...)