Spaces:
Sleeping
Sleeping
Update lib/content-utils.ts
Browse files- lib/content-utils.ts +4 -1
lib/content-utils.ts
CHANGED
|
@@ -62,7 +62,10 @@ export function extractKeyword(item: any): { keyword: string; volume: number | n
|
|
| 62 |
export function formatVolume(v: number | string | null | undefined): string | null {
|
| 63 |
if (v === null || v === undefined || v === '') return null;
|
| 64 |
|
| 65 |
-
//
|
|
|
|
|
|
|
|
|
|
| 66 |
if (typeof v === 'string' && isNaN(Number(v))) {
|
| 67 |
return v;
|
| 68 |
}
|
|
|
|
| 62 |
export function formatVolume(v: number | string | null | undefined): string | null {
|
| 63 |
if (v === null || v === undefined || v === '') return null;
|
| 64 |
|
| 65 |
+
// On traite "N/A" comme null pour que le composant UI affiche son fallback (ex: '< 10')
|
| 66 |
+
if (v === 'N/A') return null;
|
| 67 |
+
|
| 68 |
+
// Si c'est une chaîne non numérique (ex: "E:ERR"), on l'affiche telle quelle
|
| 69 |
if (typeof v === 'string' && isNaN(Number(v))) {
|
| 70 |
return v;
|
| 71 |
}
|