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

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 20, 2021, 12:44pm UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695/8 "2021-08-20T12:44:12Z")

</div>

@heliosdrm, that is really nice.  
We can then even broadcast `Printf` to arrays using your solution:

```julia
v = rand(10)
f = Ref(Printf.Format("%5.2f"));
Printf.format.(f,v)

```

---

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