Specify type `g` decimal to exponential break point
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Start by reading the number formatting documentation and the implementation of the g format type; the issue does not name specific files or tests. Check how the precision option controls the decimal-to-exponential switch, then add a way to set the requested breakpoint and test the examples in the issue. Done means values beyond the chosen decimal-place threshold use exponential notation while the shown smaller values remain decimal.
Written by the indexing model from the issue text.
Description
Is there a to specify at how many decimal places type g switches from decimal to exponential?
I'd like to format everything with more than 3 decimal places as exponential:
expect(d3.format('.3~g')(0.1)).toBe('0.1')
expect(d3.format('.3~g')(0.01)).toBe('0.01')
expect(d3.format('.3~g')(-0.001)).toBe('-0.001')
expect(d3.format('.3~g')(-0.0001)).toBe('−1e-4') // actual: −0.0001
expect(d3.format('.3~g')(-0.00001)).toBe('−1e-5') // actual: −0.00001
- Dominant language
- JavaScript
- Stars
- 643
- Forks
- 107
- Avg merge
- 6h 25m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from d3/d3-format
-
formatPrefix will sometimes not perform roundingMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 46/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
ai bug design good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
neomjs/neo-agent-institution#927 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gramps-project/gramps-web#1671 ·
Maintainers usually reply within 1 day
-
bug good first issue priority: P2 status: ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RhinoLink-Tech/data-fabric#502 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
cline/mcp-marketplace#3708 ·
-
beginner-friendly category:finding-titles community enhancement first-timers-only good first issue help wanted low hanging fruit micro-contribution type: task up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Berserk-hub150/skillhawk#264 · 1 comment ·
Maintainers usually reply within 4 days