Skip to content

Commit

Permalink
Let's not format years as numbers 🤪
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Nov 28, 2024
1 parent be94c65 commit 2f630ca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions components/paths/graphs/IndicatorSparkline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ const IndicatorSparkline = (props: IndicatorSparklineProps) => {
showMaxLabel: true,
hideOverlap: false,
fontSize: 10,
formatter: function (value: number) {
return format.number(value);
},
},
data: allYears,
axisTick: {
Expand Down Expand Up @@ -241,9 +238,9 @@ const IndicatorSparkline = (props: IndicatorSparklineProps) => {
params.forEach((param) => {
const value = param.value[param.dimensionNames[param.encode.y]];
if (value !== null) {
result += `${param.seriesName}: ${format.number(value)} ${
indicator.unit.shortName || indicator.unit.name
}<br/>`;
result += `${param.seriesName}: ${format.number(value, {
maximumSignificantDigits: 2,
})} ${indicator.unit.shortName || indicator.unit.name}<br/>`;
}
});
return result;
Expand Down

0 comments on commit 2f630ca

Please sign in to comment.