Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set the numerical progression to decimal for all UInt types? #3130

Closed
aaravlu opened this issue Jan 1, 2025 · 2 comments
Closed

Comments

@aaravlu
Copy link

aaravlu commented Jan 1, 2025

The output always show hexadecimal for all UInt types.

I think it is a little inconvenient to read.

image

@aaravlu aaravlu changed the title How can I set the numerical progression to decimal for all UInt type? How can I set the numerical progression to decimal for all UInt types? Jan 1, 2025
@holomorphism
Copy link
Contributor

Since the UInt (Unsigned) types are displayed in hexadecimal by default in the REPL, I think it is appropriate for Pluto to do the same.

If you want to display a value of type UInt64 as a decimal number, the easiest way is to convert it to a String or Int128.
image

You can also redefine Base.show if you want to always change the way Unsigned types are output in your notebook.
image

function Base.show(io::IO, ::MIME"text/html", x::Unsigned)
    print(io, string(x))
end

@aaravlu
Copy link
Author

aaravlu commented Jan 2, 2025

Thanks.
Of course I know converting it to String can obtain a better reading feel.
Thanks again if there are not any settings in Pluto can achieve an effect like that.

@aaravlu aaravlu closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants