Can anyone point me to formatting string. I have an output where I want to control

can anyone point me to formatting string. I have an output where I want to control the spacing of everything and have it separated like this

#This is what I have
"converged: true |...."
"converged: false |...."

#This is what I want
"converged: true |...."
"converged: false|...."

Also for numbers to be rounded in the text

#What I have 
"6.02341235"

#What I want
"6.02"

Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message :slack:) (More Info)

1 Like
julia> using Printf

julia> @sprintf("converged: %s |....", rpad(true, 5))
"converged: true  |...."

julia> @sprintf("converged: %s |....", rpad(false, 5))
"converged: false |...."

julia> @sprintf("%.2f", 6.02341235)
"6.02"
1 Like