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

Decimal seperator for USD / EUR / finance numbers #249

Closed
chinese-soup opened this issue Feb 19, 2021 · 7 comments
Closed

Decimal seperator for USD / EUR / finance numbers #249

chinese-soup opened this issue Feb 19, 2021 · 7 comments

Comments

@chinese-soup
Copy link

chinese-soup commented Feb 19, 2021

Hello.
I couldn't find this specific issue, so hopefully it's not a duplicate.

I'd like to ask if anyone would consider adding a configurable(?) decimal seperator for numbers. This is useful mainly in I guess financial kind of calculations where scientific notation isn't very practical to the human eye. I'm thinking at least either for USD / EUR / custom currency variable / etc. answers or some user configurable setting for all the numbers that would otherwise not end up being delimited.

See:
https://en.wikipedia.org/wiki/Decimal_separator#Examples_of_use

Example:
Current behavior:

>>> 1000 × 6

  1000 × 6

   = 6000

Proposed behavior:
a)

>>> decimal_seperator = "'"  # or something along the lines of
>>> 1000 × 6

  1000 × 6

   = 6'000

>>> decimal_seperator = " "
>>> 1000 × 6

  1000 × 6

   = 6 000

b)

>>> 1000 × 6 USD

  1000 × 6 USD

   = 6,000 USD # US uses USD, US uses comma , as a delimiter etc.

What do you think?

@sharkdp
Copy link
Owner

sharkdp commented Feb 20, 2021

Thank you for your request.

It kind of came up here: #104, #175.

So far, we have a .insectrc startup file, but insect doesn't really have any configuration settings so far. But it's definitely something that could be implemented.

For a long time, I have been planning a full rewrite of insect. Having user-settings like this would definitely be something that would be included in a v2. That being said, it should also be possible to include this in the current version. The problem is that almost no one is familiar with PureScript. That's the main reason why I would rewrite the project.

@triallax
Copy link
Contributor

That's the main reason why I would rewrite the project.

Rewrite it as in another language? If so, what are some candidates?

@sharkdp
Copy link
Owner

sharkdp commented Jun 30, 2021

There are no serious plans, but I once started a small experiment in Rust, using nom to build a parser. I think it would be a good fit because the PureScript version is starting to show some performance problems. Rust would be a good fit because we could still target both the web (WASM) and the terminal.

@triallax
Copy link
Contributor

I think it would be a good fit because the PureScript version is starting to show some performance problems.

I would be interested in taking a stab at fixing those problems. Any examples (maybe a new issue should be made for this)?

@sharkdp
Copy link
Owner

sharkdp commented Jun 30, 2021

There are two things that come to my mind right now:

  • The startup time of the terminal version
  • The (somewhat ridiculous) long time to run the whole test suite.

@triallax
Copy link
Contributor

This is only tangentially related (the issue says nothing of separators in input, only output), but I've been thinking about having a separator like _ (so you can input e.g. 1_234_567). _ was added recently as an alias for ans (#159), but we should be able to work out a way to disambiguate between the two.

Note that I personally don't really care about having a _ separator, so I won't be adding it until somebody asks for it.

@sharkdp
Copy link
Owner

sharkdp commented Sep 26, 2023

That follow up project is now here! And we also have a follow-up ticket: sharkdp/numbat#152

@sharkdp sharkdp closed this as completed Sep 26, 2023
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