Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format "%0.2f" rejected as legacy format, contrary to documentation #6535

Closed
vicuna opened this issue Sep 2, 2014 · 2 comments
Closed

format "%0.2f" rejected as legacy format, contrary to documentation #6535

vicuna opened this issue Sep 2, 2014 · 2 comments
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 2, 2014

Original bug ID: 6535
Reporter: Nick Chapman
Status: closed (set by @damiendoligez on 2016-04-06T11:48:00Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+beta1 / +rc1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.02.1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche

Bug description

http://caml.inria.fr/pub/docs/manual-ocaml/libref/Printf.html

Conversion specifications have the following form:
% [flags] [width] [.precision] type

In 4.02, the '0' flag causes the width to be mandatory, which although quite reasonable is not explicitly required by the documentation. Probably the documentation should be fixed.

Steps to reproduce

$ ocaml -strict-formats
OCaml version 4.02.1+dev0-2014-08-29

Printf.printf "[%0.2f]\n" 1.2;;

Characters 14-25:
Printf.printf "[%0.2f]\n" 1.2;;
^^^^^^^^^^^
Error: invalid format "[%0.2f]\n": at character number 2, '0' without padding

@vicuna
Copy link
Author

vicuna commented Sep 15, 2014

Comment author: @damiendoligez

The documentation is full of holes and needs to be completed.

@vicuna
Copy link
Author

vicuna commented Apr 6, 2016

Comment author: @damiendoligez

This was fixed in 4.02.1.

@vicuna vicuna closed this as completed Apr 6, 2016
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant