diff --git a/documentation/README.md b/documentation/README.md index c7a073c1..dc1066d7 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -154,7 +154,7 @@ sections: color: 'blue' - type: number value: '0.454' - title: 'Kilographs in a pound' + title: 'Kilograms in a pound' color: 'red' - type: number value: '1.06' diff --git a/examples/static-values.yml b/examples/static-values.yml index 4473b7b0..b61fe49a 100644 --- a/examples/static-values.yml +++ b/examples/static-values.yml @@ -16,7 +16,7 @@ sections: color: 'blue' - type: number value: '0.454' - title: 'Kilographs in a pound' + title: 'Kilograms in a pound' color: 'red' - type: number value: '1.06' diff --git a/index.js b/index.js index c1f7cf1c..e35bf679 100644 --- a/index.js +++ b/index.js @@ -2678,7 +2678,7 @@ class HtmlRenderer { for (let element of widget.elements) { let num = element; let value = num.value; - let scaled = Math.floor((value / max) * 100); + let scaled = (max > 0) ? Math.floor((value / max) * 100) : 0; html.push(`
`); html.push(``); if (num.title != null) {