Skip to content

Commit

Permalink
Check amount to avoid NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhn committed Dec 6, 2024
1 parent 7777c29 commit dc1994f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Card, CardContent, Typography } from '@socialincome/ui';
import _ from 'lodash';
import { SectionProps } from './page';

export const roundAmount = (amount: number) => Math.round(amount / 10) * 10;
export const roundAmount = (amount: number) => (!isNaN(amount) ? Math.round(amount / 10) * 10 : 0);

export async function Section1({ params, paymentStats, contributionStats }: SectionProps) {
const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-finances'] });
Expand Down

0 comments on commit dc1994f

Please sign in to comment.