# Error while formatting a specific number!

**URL:** https://discourse.julialang.org/t/error-while-formatting-a-specific-number/64172
**Category:** New to Julia
**Tags:** numbers, formatting
**Created:** [July 6, 2021, 7:46pm UTC](https://discourse.julialang.org/t/error-while-formatting-a-specific-number/64172 "2021-07-06T19:46:57Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [July 6, 2021, 8:03pm UTC](https://discourse.julialang.org/t/error-while-formatting-a-specific-number/64172/3 "2021-07-06T20:03:51Z")

</div>

There seem to be some longstanding bugs in the floating-point formatting provided by the Formatting.jl package (e.g. [printfmt("1:.4e, 40000.0) prints 3.10000e+04 · Issue #71 · JuliaIO/Formatting.jl · GitHub](https://github.com/JuliaIO/Formatting.jl/issues/71)).

I would tend to recommend using Julia’s [`Printf` standard library](https://docs.julialang.org/en/v1/stdlib/Printf/) instead:

```nohighlight
julia> using Printf

julia> @sprintf("%0.4E", 3.0e-8)
"3.0000E-08"

```

PS. Please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).

---

_[View the full topic](https://discourse.julialang.org/t/error-while-formatting-a-specific-number/64172)._
