Today's High
{daily?.temperature_2m_max?.[0] != null ? Math.round(daily.temperature_2m_max[0]) + unit : '--'}
Today's Low
{daily?.temperature_2m_min?.[0] != null ? Math.round(daily.temperature_2m_min[0]) + unit : '--'}
{#if hourly}
{@const temps = hourly.temperature_2m || []}
{@const validTemps = temps.filter(t => t != null)}
{#if validTemps.length > 0}
24h Average
{Math.round(validTemps.reduce((a, b) => a + b, 0) / validTemps.length)}{unit}
{/if}
{/if}
Precip Chance
{daily?.precipitation_probability_max?.[0] || 0}%