I am trying to render an element from a Float32Array using Svelte.
let laterTimeIndex = hourlyWeatherData.time
.find((timeData: Date) =>
timeData.getHours() === (currentTime + 5) % 24
);
let laterTemperature = hourlyWeatherData.temperature_2m[
hourlyWeatherData.time.indexOf(laterTimeIndex)
];
$inspect(laterTimeIndex);
$inspect(laterTemperature);
<div class="weather">
<div class="weather-card weather-now">
<p>Weather Now: {currentPeriod}, {currentWeatherData.temperature_2m}</p>
</div>
<div class="weather-card weather-later">
<p>Weather Later: {laterPeriod}, {laterTemperature}</p>
</div>
</div>
For context, hourlyWeatherData is a prop that contains multiple Float32Array. The arrays are return results of an API. Array temperature_2m was one of the Float32Array.
I was able to get the value when I used $inspect rune but cannot get the value to render on the browser like shown below
What could be the issue and are there workarounds I can try to get around the issue?