jspreadsheet / jspreadsheet/ce

Number formatting with a mask

Open
#1,760 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.2k
Forks
890
PR merge metrics
No merged PRs in 30d

Description

Related to #614.
When using a mask (e.g. "$ #,##0") or currency format (eg., taken from docs: {locale: 'en-IN',options: { style:'currency', currency: 'INR' }}), if the first value entered in an empty cell is zero, the cell is blanked and the onafterchanges event does not fire. If you enter any non-zero value and then enter zero, the zero is retained.

You can see this behaviour in the jspreadsheet docs: https://bossanova.uk/jspreadsheet/docs/format.

In the "Currency Formatting" example - trying to enter 0 into column A demonstrates the described behaviour. Same lower down in the "Data Grid with Different Currencies" example. There are values with zero already present, so they will accept typing zero - but empty cells below will not unless you enter something else first.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the Jspreadsheet documentation's Currency Formatting and Data Grid with Different Currencies examples at the linked format page. Trace the number-mask or currency-format handling for zero entered into an empty cell; done means zero remains visible and the onafterchanges event fires on the first entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.