Skip to content

Commit

Permalink
improve @(s)printf docstrings (JuliaLang#47583)
Browse files Browse the repository at this point in the history
  • Loading branch information
st-- authored Nov 29, 2022
1 parent 4fd26ba commit 4d5fd91
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/Printf/src/Printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ Use shorter of decimal or scientific 1.23 1.23e+07
For a systematic specification of the format, see [here](https://www.cplusplus.com/reference/cstdio/printf/).
See also [`@sprintf`](@ref) to get the result as a `String` instead of it being printed.
If you need to use a programmatically generated format string, use
`print(Printf.format(Printf.Format(format_string), args...))` instead.
See [`Printf.format`](@ref) for more details.
# Caveats
`Inf` and `NaN` are printed consistently as `Inf` and `NaN` for flags `%a`, `%A`,
`%e`, `%E`, `%f`, `%F`, `%g`, and `%G`. Furthermore, if a floating point number is
Expand Down Expand Up @@ -951,6 +955,10 @@ end
Return [`@printf`](@ref) formatted output as string.
If you need to use a programmatically generated format string, use
`Printf.format(Printf.Format(format_string), args...)` instead.
See [`Printf.format`](@ref) for more details.
# Examples
```jldoctest
julia> @sprintf "this is a %s %15.1f" "test" 34.567
Expand Down

0 comments on commit 4d5fd91

Please sign in to comment.