From 3c888f0503b9bd8fe1a3d5660f819d7826f58a1a Mon Sep 17 00:00:00 2001 From: Akira Date: Sat, 28 Feb 2026 13:48:25 +0900 Subject: [PATCH] =?UTF-8?q?Tooltip=20formatter=20=E3=81=AE=20TypeScript=20?= =?UTF-8?q?=E5=9E=8B=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/app/weather/page.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/weather/page.tsx b/frontend/src/app/weather/page.tsx index dcca6be..9d8a6be 100644 --- a/frontend/src/app/weather/page.tsx +++ b/frontend/src/app/weather/page.tsx @@ -214,7 +214,10 @@ export default function WeatherPage() { domain={['auto', 'auto']} /> value == null ? '—' : `${value.toFixed(1)}℃`} + formatter={(value: unknown) => { + if (value == null || typeof value !== 'number') return '—'; + return `${value.toFixed(1)}℃`; + }} /> `${v}h`} /> { - if (value == null) return '—'; + formatter={(value: unknown, name: unknown) => { + if (value == null || typeof value !== 'number') return '—'; return name === '降水量' ? `${value} mm` : `${value} h`; }} />