# How to change default number of digits printed for PrettyPrint

**URL:** https://discourse.julialang.org/t/how-to-change-default-number-of-digits-printed-for-prettyprint/114463
**Category:** New to Julia
**Tags:** formatting, pretty-printing
**Created:** [May 20, 2024, 1:52am UTC](https://discourse.julialang.org/t/how-to-change-default-number-of-digits-printed-for-prettyprint/114463 "2024-05-20T01:52:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![freedomjin](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@freedomjin](https://discourse.julialang.org/u/freedomjin)
#### Post date: [May 20, 2024, 1:52am UTC](https://discourse.julialang.org/t/how-to-change-default-number-of-digits-printed-for-prettyprint/114463/1 "2024-05-20T01:52:36Z")

</div>

Hi,  
I found [`PrettyPrint.jl`](https://github.com/thautwarm/PrettyPrint.jl) quite handy when printing complex data structures, however, for large nested structures, `pprint` attempts to show all `Float` values to maximum precision and often overflows entire screen.

Is it possible to set default precision to, say, 4 digits? I tried to add kw args such as `precision=4`, `digits=4`, `".4f%"`, etc., none of them worked.

Moreover, sometimes it is best to suppress values of `struct` fields as they may contain arrays. Is it possible to only `pprint` field names and their types of the input `struct`?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [May 20, 2024, 2:22am UTC](https://discourse.julialang.org/t/how-to-change-default-number-of-digits-printed-for-prettyprint/114463/2 "2024-05-20T02:22:41Z")

</div>

This readme might help

> **[GitHub - ma-laforge/NumericIO.jl: Fine control over numeric output:...](https://github.com/ma-laforge/NumericIO.jl)**
>
> Fine control over numeric output: Scientific/Engineering/SI-notation +UTF8 - ma-laforge/NumericIO.jl

---

<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: [May 20, 2024, 10:02pm UTC](https://discourse.julialang.org/t/how-to-change-default-number-of-digits-printed-for-prettyprint/114463/3 "2024-05-20T22:02:11Z")

</div>

Would [this simple solution](https://discourse.julialang.org/t/how-to-print-a-number-to-x-digits/50526/3) help?
