Bonjour à tous,
Dans une base de donnée rassemblant les données journalières d'une station météo, je voudrai connaître l'indice UV maximum de la journée et non oas sur la base entière. J'ai crée ce code mais il me renvoi NaN alors que les données ne sont que des chiffres (0 à 15). J'ai crée un tableau et j'utilise Math.max pour rechercher dans ce tableau la valeur maximum.
Merci pour votre aide.
Hello everyone,
In a database containing daily data from a weather station, I want to know the maximum UV index for the day, not the maximum UV index for the entire database. I created this code, but it returns NaN even though the data consists only of numbers (0 to 15). I created an array and I'm using Math.max to search for the maximum value within it.
Thank you for your help.
//---CALCUL INDICE UV
//---DECLARATIONS VARIABLES ---
var e = entry();
var UV8 = entry().field("Indice UV 8");
var UV9 = entry().field("Indice UV 9");
var UV10 = entry().field("Indice UV 10");
var UV11 = entry().field("Indice UV 11");
var UV12 = entry().field("Indice UV 12");
var UV13 = entry().field("Indice UV 13");
var UV14 = entry().field("Indice UV 14");
var UV15 = entry().field("Indice UV 15");
var UV16 = entry().field("Indice UV 16");
var UV17 = entry().field("Indice UV 17");
var UV18 = entry().field("Indice UV 18");
var UV19 = entry().field("Indice UV 19");
var UV20 = entry().field("Indice UV 20");
//-CREATION TABLEAU
var UV = [UV8 , UV9, UV10 , UV11 , UV12 (UV13 , UV14 , UV15 , UV16 , UV17 , UV18 , UV19 , UV20];
//-RECHERCHE MAX
var UV1 = Math.max(UV);
//-RESULTATS
"▪︎ ☀️ ▪︎ "+UV1+"\t\t\t\t\t\t\t\t("+ UV //<< CONTRÔLE