# String representation of unitful types

**URL:** https://discourse.julialang.org/t/string-representation-of-unitful-types/83535
**Category:** General Usage
**Tags:** unitful
**Created:** [June 29, 2022, 9:11pm UTC](https://discourse.julialang.org/t/string-representation-of-unitful-types/83535 "2022-06-29T21:11:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)
#### Post date: [June 29, 2022, 9:11pm UTC](https://discourse.julialang.org/t/string-representation-of-unitful-types/83535/1 "2022-06-29T21:11:45Z")

</div>

```julia
julia> typeof(1.0u"kg/m^3") <: Number
true
julia> typeof(1.0u"kg/m^3")
Quantity{Float64, 𝐌 𝐋 ^-3, Unitful.FreeUnits{(kg, m^-3), 𝐌 𝐋 ^-3, nothing}}
julia> Quantity{Float64, 𝐌 𝐋 ^-3, Unitful.FreeUnits{(kg, m^-3), 𝐌 𝐋 ^-3, nothing}} <: Number
ERROR: syntax: missing comma or } in argument list

```

How can I get a string representation of a unitful type in a such way that it can be parsed back by Julia? For other types it was as simple as `string(Symbol(T))`

---

<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: [July 1, 2022, 6:43am UTC](https://discourse.julialang.org/t/string-representation-of-unitful-types/83535/2 "2022-07-01T06:43:15Z")

</div>

Fyi, your question seems to be related to [this open Unitful.jl issue](https://github.com/PainterQubits/Unitful.jl/issues/412).
