# How do I restrict the number of digits in the REPL display?

**URL:** <https://discourse.julialang.org/t/how-do-i-restrict-the-number-of-digits-in-the-repl-display/107501>\
**Category:** New to Julia\
**Tags:** repl, io, rounding\
**Created:** [December 12, 2023, 2:37pm UTC](https://discourse.julialang.org/t/how-do-i-restrict-the-number-of-digits-in-the-repl-display/107501 "2023-12-12T14:37:19Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [December 12, 2023, 5:53pm UTC](https://discourse.julialang.org/t/how-do-i-restrict-the-number-of-digits-in-the-repl-display/107501/4 "2023-12-12T17:53:21Z")

</div>

To use a variable in the `Printf` format string, see for example [this post](https://discourse.julialang.org/t/printf-with-variable-format-string/3805/10).

You could define your function in the `startup.jl` file.

---

_[View the full topic](https://discourse.julialang.org/t/how-do-i-restrict-the-number-of-digits-in-the-repl-display/107501)._
