numbat icon indicating copy to clipboard operation
numbat copied to clipboard

Formatting integer output without underscores

Open charlescochran opened this issue 1 year ago • 2 comments

>>> 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.

charlescochran avatar Sep 03 '24 02:09 charlescochran

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.

Goju-Ryu avatar Sep 04 '24 09:09 Goju-Ryu

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: https://github.com/sharkdp/numbat/issues/394

sharkdp avatar Sep 04 '24 13:09 sharkdp