We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 945ee44 commit 35438a1Copy full SHA for 35438a1
app/viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders.ts
@@ -1057,8 +1057,9 @@ function getPriorityPathogenEntityBreadcrumbs(
1057
/**
1058
* Format a number to a string.
1059
* @param value - Number to format.
1060
- * @returns Formatted number.
+ * @returns Formatted number or empty string if invalid.
1061
*/
1062
-export function formatNumber(value: number | null): string {
1063
- return value?.toLocaleString() || "";
+export function formatNumber(value: unknown): string {
+ if (typeof value !== "number" || Number.isNaN(value)) return "";
1064
+ return value.toLocaleString();
1065
}
0 commit comments