Skip to content

Commit ecf0d51

Browse files
tweak
1 parent 92bad46 commit ecf0d51

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

js/elements.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ function get_domrect(METRIC) {
4949
if (oDiffs[m].length > 1) {multiples.push(oDiffs[m].join(' + '))}
5050
}
5151
console.log(k, oDiffs, multiples, max)
52-
max = (max > 0.01 ? '>' : '<') + ' 0.01'
52+
if (max > 0.1) {max = '> ±0.1'
53+
} else {
54+
// note max is always positive
55+
var z = -Math.floor(Math.log10(max) + 1) // leading zeros
56+
max = '< ±0.' + '0'.repeat(z-1) + '1'
57+
}
5358
value = {
5459
'properties': aProps.length == 8 ? 'all' : aProps.join(', '),
55-
'range': '± ' + max,
60+
'range': max,
5661
'same': (multiples.length ? multiples : 'none'),
5762
'total': Object.keys(oDiffs).length
5863
}

0 commit comments

Comments
 (0)