# Workspace doesn't display UInt values

**URL:** https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073
**Category:** New to Julia
**Tags:** juno
**Created:** [July 5, 2021, 11:40am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073 "2021-07-05T11:40:51Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 5, 2021, 11:40am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/1 "2021-07-05T11:40:51Z")

</div>

I’ve just started using Julia and I wanted something nice to start working in, so I’ve downloaded and installed JuliaPro. All good. But I’ve just noticed something that’s annoying me lots and I don’t know if it can be fixed.

I use the Workspace quite a bit as I’m writing code and it’s particularly useful as I try to transfer my python code across. However, it seems that unsigned ints cannot be displayed in the Workspace (see image) - is this correct? Is there a setting that needs to be changed? It’s super annoying to have to use println(fileversion) everywhere!

![image](https://global.discourse-cdn.com/julialang/original/3X/2/b/2b4460f5f7072d6b32f58b47db7a980a541bd271.png)

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [July 5, 2021, 11:43am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/2 "2021-07-05T11:43:37Z")

</div>

The workspace uses the normal Julia `show` methods for displaying `UInt`s:

```julia
julia> UInt32(2621970)
0x00280212

```

---

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 5, 2021, 11:44am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/3 "2021-07-05T11:44:48Z")

</div>

Is there a way to change this so that it shows the actual `Int` value?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [July 5, 2021, 11:48am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/4 "2021-07-05T11:48:23Z")

</div>

That _is_ the actual value.

You can overwrite the relevant `show` method with

```julia
julia> Base.show(io::IO, n::Unsigned) = print(io, n)

julia> UInt32(123)
123

```

but that’s type privacy and thus not recommended.

---

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 5, 2021, 11:55am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/5 "2021-07-05T11:55:18Z")

</div>

Ok, thanks for the solution.

But I would argue that the actual value is the ‘Int’, whereas what is displayed is the hexadecimal representation of that ‘Int’. But I guess this is just how Julia does things.

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [July 5, 2021, 11:57am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/6 "2021-07-05T11:57:10Z")

</div>

The _values_ are the same, just differently represented.  
Personally, I don’t necessarily like that `Unsigned`s are printed in base-16, but Juno at least doesn’t do anything special here. We could show the base-10 representation in a tooltip or something, but Juno isn’t actively developed anymore, so that’s unlikely to happen 😉

---

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 5, 2021, 12:01pm UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/7 "2021-07-05T12:01:09Z")

</div>

> [@pfitzseb](#):
>
> The _values_ are the same, just differently represented.

That’s exaclty what I should have said. For cursory checks, base-10 would be so much easier for simple brains like mine. And would remove lots of print statements that will inevitably get forgotten/lost.

Anything similar to Juno that is actively developed?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [July 5, 2021, 12:02pm UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/8 "2021-07-05T12:02:40Z")

</div>

> [@jpmorr](#):
>
> Anything similar to Juno that is actively developed?

Yes: [https://www.julia-vscode.org/](https://www.julia-vscode.org/)

---

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [July 5, 2021, 1:17pm UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/9 "2021-07-05T13:17:17Z")

</div>

> [@jpmorr](#):
>
> For cursory checks, base-10 would be so much easier

I’m not sure… Typically, `Int` is used for variables that represent a size or count, where base 10 is more natural indeed, and `UInt` is often used for values where individual bits or bytes have a meaning.

There are good reasons for this… See a [recent discussion](https://discourse.julialang.org/t/why-int-instead-of-uint-for-indexing/63589) about why indices and `length` use `Int`.

Maybe it’s different in your case, but I see two masks in your list. Would they be more readable in base 10? (I guess not.)

For `full_timestep` maybe it would make sense to use an `Int`?

For `fileversion` it depends how the version is encoded… For example `0x00280212` could be the code for a version of the form “x.y” as two 16-bit values: `0x0028` and `0x0212`. This would arguably be less readable in base 10.

---

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 5, 2021, 4:04pm UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/10 "2021-07-05T16:04:57Z")

</div>

You are correct about the masks, I’m not really interested in reading those at all, but there are many other variables that are also `UInt` that I want to see quickly but weren’t in the attached screenshot.

The historical context of `Int` vs `UInt` is interesting, but as these values are all attributes in HDF5 files that I’m reading from some 3rd party software, I just need to be able to read and check these attributes quickly.

---

<div class="post-metadata">

### Author: ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)
#### Post date: [July 5, 2021, 7:14pm UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/11 "2021-07-05T19:14:37Z")

</div>

> [@jpmorr](#):
>
> I just need to be able to read and check these attributes quickly.

Then you should probably just do something like `fileversion_signed = Int(fileversion)` and check this variable in the workspace instead.

---

<div class="post-metadata">

### Author: ![jpmorr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpmorr/32/26819_2.png) [@jpmorr](https://discourse.julialang.org/u/jpmorr)
#### Post date: [July 6, 2021, 11:31am UTC](https://discourse.julialang.org/t/workspace-doesnt-display-uint-values/64073/12 "2021-07-06T11:31:45Z")

</div>

Yes, I’m now converting to an `Int` when I read the file and save it into a `struct`, but when exploring and protyping I would have prefererred to just view in the Workspace. It’s just a minor annoyance at this stage.
