# 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:** 2

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [August 20, 2021, 12:11am UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695/2 "2021-08-20T00:11:18Z")

</div>

In Julia 1.6 you can use `Printf.Format`, and then `Printf.format` instead of the macro:

```julia-repl
julia> f = Printf.Format("%9.3f "^4);

julia> Printf.format(f, 1,2,3,4)
" 1.000 2.000 3.000 4.000 "

julia> Printf.format(stdout, f, 1,2,3,4)
    1.000 2.000 3.000 4.000 

```

(Well, there is an unwanted trailing space in this example, but this can be easily worked around with other ways of making the format string.)

---

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