formatPrefix will sometimes not perform rounding

Open
#132 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #156 by @apoorva-01 — closed without merging

Assessment

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

Research direction

Start by tracing how formatPrefix scales values and applies precision, then look for existing rounding tests in the test suite. Reproduce the reported call with 1555 and confirm it formats as 1.56; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Description

For example: d3.formatPrefix(',.2', 1e3)(1555) produces 1.55, should be 1.56.

This is likely a simple fix, but unfortunately I'm not adept enough to figure out the source code and submit a PR, sorry.

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

  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.

More from d3/d3-format

All issues in d3/d3-format

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.