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

Comma as decimal separator doesn't work as intended, using editor = 'input' for a column cell #4460

Closed
AndrasEliassen opened this issue Apr 10, 2024 · 1 comment
Labels
Possible Bug A possible bug that needs investigation

Comments

@AndrasEliassen
Copy link

Describe the bug
Tabulator doesn't seem to allow using comma as the decimal separator, as we usually do in our part of the world (nordic countries)

I instantiate the column with instructions that the comma should be the decimal sign:

formatterParams: { decimal: ",", thousand: ".", symbol: "", symbolAfter: "", precision: 2 },

Tabulator Info
6.2.0

Working Example
https://jsfiddle.net/iSolveIT/1qjds6gk/2/

To Reproduce
A step by step guide to recreate the issue in the JS Fiddle or Codepen:

  1. Go to https://jsfiddle.net/iSolveIT/1qjds6gk/2/
  2. Click on a debit or credit cell
  3. Write some decimal value into the cell, using comma as the decimal separator
  4. Press TAB and see the error as the value will change to "[something],00"

Expected behavior
When instructing the column to use comma as decimal separator, the comma should work as the decimal separator

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser chrome, edge, safari and firefox
@AndrasEliassen AndrasEliassen added the Possible Bug A possible bug that needs investigation label Apr 10, 2024
@olifolkerd
Copy link
Owner

Hey @AndrasEliassen

There is a misunderstanding here. The formatter is purely display only and is completely unrelated to the editor. the formatter is doing its job as anticipated.

This issue you have here is that you are using a standard input editor which is just expecting a standard text string, therefor it is just treating it as a numeric value, which JavaScript is expecting standard numeric notation of a "." for the decimal separator.

You would need to use an Edit Mutator to translate your string into a number that JavaScript can understand.

Cheers

Oli :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants