The ambient temperature in Celsius.
The relative humidity as a percentage (0-100).
The calculated humidex value in Celsius, rounded to the nearest whole number. Returns the original temperature if the calculated humidex is lower.
// Calculate humidex for a warm and humid day.
const humidex = getHumidex(30, 70); // returns 41
console.log(`Humidex: ${humidex}`);
Calculates the humidex factor in Celsius based on the given temperature in Celsius and humidity percentage.
If the calculated humidex is less than the provided temperature, the temperature itself is returned.
This calculation uses the formula provided by the Canadian Centre for Climate Services.