supportchef / covid-by-region

Plotting cases of COVID-19 by region and across regions over time
https://covidbyregion.com
5 stars 0 forks source link

Round graph data to 1 decimal place #5

Closed ronshapiro closed 4 years ago

ronshapiro commented 4 years ago

I could have used n.toLocaleString(undefined, {maximumFractionDigits: 1}), where the undefined is passed for the locales parameter (which we want to stay as the user locale). I felt the undefined was a little awkward, and the math is simple enough, but if you feel otherwise I can change it.

Before:

Screen Shot 2020-04-02 at 15 27 44

After:

Screen Shot 2020-04-02 at 15 13 20