| Anonymous | Login | Signup for a new account | 2013-05-24 12:53 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004902 | OCaml | OCaml general | public | 2009-10-30 05:06 | 2009-10-30 13:45 | |||
| Reporter | furuse | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | major | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11.1 | |||||||
| Target Version | Fixed in Version | 3.11.2+dev | ||||||
| Summary | 0004902: Printf.sprintf "%1.F" 123.456 returns "12." !! | |||||||
| Description | The summary tells everything. The fix is easy: diff --git a/stdlib/printf.ml b/stdlib/printf.ml --- a/stdlib/printf.ml +++ b/stdlib/printf.ml @@ -435,7 +435,7 @@ let add_dot sfmt s = if s.[0] = ' ' || s.[0] = '+' || s.[0] = '0' then String.sub s 1 (l - 1) ^ "." - else String.sub s 0 (l - 1) ^ "." in + else String.sub s 0 l ^ "." in let rec loop i = if i >= l then add_dot sfmt s else | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0005144) furuse (reporter) 2009-10-30 05:35 |
I see the function format_float_lexem is largely rewritten in the trunk version. The issue is gone in the trunk, but I think it is still worth reporting. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-10-30 05:06 | furuse | New Issue | |
| 2009-10-30 05:35 | furuse | Note Added: 0005144 | |
| 2009-10-30 13:45 | doligez | Status | new => closed |
| 2009-10-30 13:45 | doligez | Resolution | open => fixed |
| 2009-10-30 13:45 | doligez | Fixed in Version | => 3.11.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |