# How to repeat the format in @printf?

**URL:** <https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695>\
**Category:** General Usage\
**Tags:** io\
**Created:** [August 19, 2021, 11:48pm UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695 "2021-08-19T23:48:58Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [August 20, 2021, 11:37pm UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695/11 "2021-08-20T23:37:42Z")

</div>

I like this way as well:

```julia
julia> using Printf

julia> myformat(x) = @sprintf("%5.2f",x)
myformat (generic function with 1 method)

julia> x = rand(3);

julia> println(myformat.(x)...)
 0.15 0.68 0.58

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695)._
