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

**URL:** https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431
**Category:** General Usage
**Created:** [February 17, 2021, 12:54am UTC](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431 "2021-02-17T00:54:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)
#### Post date: [February 17, 2021, 12:54am UTC](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431/1 "2021-02-17T00:54:40Z")

</div>

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

```julia
#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

```julia
#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:)](https://julialang.slack.com/archives/C6A044SQH/p1613523262017100?thread_ts=1613523262.017100&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [February 17, 2021, 2:23am UTC](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431/2 "2021-02-17T02:23:28Z")

</div>

```julia
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"

```
