near-zero and near-100 rounding option

Aperta
#109 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
d3, javascript

Direzione di ricerca

Start by reading the percent-formatting implementation and its tests to find where rounding and format options are handled. Add a flag for displaying values that round to 0% or 100% as threshold labels such as <0.1% or >99.9%, then verify the new behavior with tests covering values near both endpoints.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Right now using a simple percent format like:

const f = format('.1%')

Gives misleading results near 0 and 100:

f(0.0001) // 0.0%
f(0.9999) // 100.0%

Even though these are technically correct from a rounding perspective, they lead to confusion for users because it reads as "absolute". Which is why it's common to instead refer these as:

<0.1%
>99.9%

It would be really nice if there was a flag for this style of percentage formatting.

Lingua principale
JavaScript
Stelle
643
Fork
107
Merge medio
6h 25m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di d3/d3-format

Tutte le issue di d3/d3-format

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.