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

Formatting integer output without underscores #554

Open
charlescochran opened this issue Sep 3, 2024 · 2 comments
Open

Formatting integer output without underscores #554

charlescochran opened this issue Sep 3, 2024 · 2 comments
Labels

Comments

@charlescochran
Copy link

>>> 16!

  16!

    = 20_922_789_888_000 

Is it possible to make numbat not format integer output with underscores? This can make it difficult to copy/paste the numbers to other tools.

@Goju-Ryu
Copy link
Contributor

Goju-Ryu commented Sep 4, 2024

I have looked through the documentation and code both, it does not appear to currently be an option. However from what I can tell, it doesn't look too difficult to implement as a configuration option, so I wouldn't rule out the possibility of it being possible in the future.

@sharkdp
Copy link
Owner

sharkdp commented Sep 4, 2024

One hack is to format it as a string:

>>> let n = 16!
>>> "{n:f}"

    = "20922789888000"    [String]

You could add a function plain (or similar) to your init.nbt like this:

fn plain(n: Scalar) -> String = "{n:f}"

and then you could use it like this:

>>> 16! -> plain

    = "20922789888000"    [String]

Also related: #394

@sharkdp sharkdp added the feature label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants