Add fixed number of decimals to legend project 2 aufgabe 3

This commit is contained in:
Marcel Schwarz 2020-11-28 05:22:17 +01:00
parent e30fcefc00
commit 725a59fefc

View File

@ -82,7 +82,7 @@ const aufgabe3 = async () => {
for (let i = 0; i < levels.length; i++) {
labels.push(
'<i style="background:' + getColor(levels[i] + 0.1) + '"></i> '
+ levels[i] + (levels[i + 1] ? '&ndash;' + levels[i + 1] : '+')
+ levels[i].toFixed(1) + (levels[i + 1] ? '&ndash;' + levels[i + 1].toFixed(1) : '+')
)
}