Skip to content

OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.

Update lib/utils.ts

Mr. Algorithm7c965b022d7d
diff --git a/lib/utils.ts b/lib/utils.ts
index 2ca823c..4031a4c 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -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)}%`;
};