blob: 16eca40c175bdb5c860d4d072bcbba3409e3c333 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
(* test whether padding modifiers are accepted without any padding
size
the precision modifier is accepted without precision setting, but it
defaults to 0, which is not the same thing as not having precision:
%.0f 3.5 => 3
%.f 3.5 => 3
%f 3.5 => 3.5
*)
let () = Printf.printf "%0d\n" 3
;;
let () = Printf.printf "%-d\n" 3
;;
let () = Printf.printf "%.d\n" 3
;;
let () = Printf.printf "%.f\n" 3.
;;
|