# Formatting syntax question

**URL:** https://discourse.julialang.org/t/formatting-syntax-question/41650
**Category:** New to Julia
**Created:** [June 18, 2020, 6:53am UTC](https://discourse.julialang.org/t/formatting-syntax-question/41650 "2020-06-18T06:53:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)
#### Post date: [June 18, 2020, 6:53am UTC](https://discourse.julialang.org/t/formatting-syntax-question/41650/1 "2020-06-18T06:53:49Z")

</div>

I have this code snippet:

```julia
using Formatting
printfmtln("{} total RAM", format(Sys.total_memory(), precision=2, autoscale=:binary))

```

which nicely prints what I expected:

```julia
15.56Gi total RAM

```

Is there a way to pack both formatting parameters `precision=2, autoscale=:binary` into the first item’s placeholder `{}`?

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [June 18, 2020, 2:00pm UTC](https://discourse.julialang.org/t/formatting-syntax-question/41650/2 "2020-06-18T14:00:56Z")

</div>

Do you mean something like:

```julia
println("$(format(Sys.total_memory(), precision=2, autoscale=:binary)) total RAM")

```

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [June 18, 2020, 3:16pm UTC](https://discourse.julialang.org/t/formatting-syntax-question/41650/3 "2020-06-18T15:16:08Z")

</div>

I don’t think so. If you check the source code, the [format spec](https://github.com/JuliaIO/Formatting.jl/blob/master/src/fmtspec.jl) mimics the Python format library. Specifically, `autoscale` isn’t supported. Precision is OK though.

---

<div class="post-metadata">

### Author: ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)
#### Post date: [June 18, 2020, 8:59pm UTC](https://discourse.julialang.org/t/formatting-syntax-question/41650/4 "2020-06-18T20:59:08Z")

</div>

It’s an interesting variation, but I meant something like this:

```julia
printfmtln("{:.2f, autoscale=:binary} total RAM", Sys.total_memory())

```

I know, I know - make a pull request. 😉
