Update lib/utils.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Mr. Algorithm 2025-10-04 19:48:41 +05:30 committed by GitHub
parent 4e42ac5b89
commit 7c965b022d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ export const formatArticle = (
});
export const formatChangePercent = (changePercent?: number) => {
if (!changePercent) return '';
if (changePercent === undefined || changePercent === null) return '';
const sign = changePercent > 0 ? '+' : '';
return `${sign}${changePercent.toFixed(2)}%`;
};