Skip to content

Commit

Permalink
[TM-1568] format numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 committed Dec 30, 2024
1 parent e83bc9d commit a1b7f01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/dashboard/charts/CustomLabelRestoration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const CustomLabel: React.FC<any> = props => {
dominantBaseline={isSmallBar ? "bottom" : "middle"}
className="text-12"
>
{`${value.toFixed(0)} ha`}
{`${Math.round(value).toLocaleString()} ha`}
</text>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/dashboardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export const parseHectaresUnderRestorationData = (
const formatValueText = (value: number): string => {
if (!total_hectares_restored) return "0 ha 0%";
const percentage = (value / total_hectares_restored) * 100;
return `${value.toFixed(0)} ha ${percentage.toFixed(2)}%`;
return `${Math.round(value).toLocaleString()} ha ${percentage.toFixed(0)}%`;
};

const getLandUseTypeTitle = (value: string): string => {
Expand Down

0 comments on commit a1b7f01

Please sign in to comment.