Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,8 @@ split_sign(n::Unsigned) = n, false
Convert an integer `n` to a string in the given `base`,
optionally specifying a number of digits to pad to.

See also [`digits`](@ref), [`bitstring`](@ref), [`count_zeros`](@ref).
See also [`digits`](@ref), [`bitstring`](@ref), [`count_zeros`](@ref),
and the Printf standard library.

# Examples
```jldoctest
Expand All @@ -986,6 +987,14 @@ julia> string(5, base = 13, pad = 4)

julia> string(-13, base = 5, pad = 4)
"-0023"

julia> using Printf

julia> @sprintf("%04i", 5)
"0005"

julia> @sprintf("%4i", 5)
" 5"
```
"""
function string(n::Integer; base::Integer = 10, pad::Integer = 1)
Expand Down