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

possible to not use scientific notation #65

Open
pinggit opened this issue May 9, 2020 · 5 comments
Open

possible to not use scientific notation #65

pinggit opened this issue May 9, 2020 · 5 comments

Comments

@pinggit
Copy link

pinggit commented May 9, 2020

I'd like to see 1234567890 instead of 1.23456789e9.
is it possible?

@arecarn
Copy link
Owner

arecarn commented May 9, 2020

You can adjust g:crunch_precision, higher than the default of 6 to something like 15 or 20, and you might get the effect you like. It doesn't disable scientific notation, but it won't be displayed as often.

e.g.
put this in your .vimrc

let g:crunch_precision = 15

@arecarn
Copy link
Owner

arecarn commented May 20, 2020

@pinggit did this work for you?

@pinggit
Copy link
Author

pinggit commented May 20, 2020 via email

@pinggit
Copy link
Author

pinggit commented May 24, 2020

it does not work.

12345678 = 1.2345678e7
12345678 + 12345678 = 2.4691356e7

after I set this to 15:
g:crunch_precision #15

@lalbornoz
Copy link

lalbornoz commented Apr 4, 2021

This does indeed not work. In autoload/crunch.vim:vim_eval():659, printf() is called w/ %g, which as per :help printf will print a floating point number, as %f or %e depending on value (e.g. possibly employing scientific notation) as opposed to %f which will print a floating point number as 12.23, inf, -inf or nan.
Hence, I propose that a new tunable (e.g. g:crunch_scientific_notation) be introduced to select between %g, %e, or %f, addressing this issue.

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

3 participants