From c0f7beb8cbf1c337895505228adc2b9c83b020b4 Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Mon, 22 Jul 2019 08:37:00 +0200 Subject: [PATCH] Finer grain for tolerance --- compare-algorithms/src/algorithms/Field.js | 2 +- compare-algorithms/src/components/RangeInput.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compare-algorithms/src/algorithms/Field.js b/compare-algorithms/src/algorithms/Field.js index 25e27b4..f9ccb52 100644 --- a/compare-algorithms/src/algorithms/Field.js +++ b/compare-algorithms/src/algorithms/Field.js @@ -27,6 +27,6 @@ export class Checkbox extends Field { export class ToleranceRange extends Range { constructor(name = 'Tolerance', id = 'tol') { - super(name, id, 0.01, 1, 0.01, 0.2) + super(name, id, 0.001, 1, 0.001, 0.2) } } diff --git a/compare-algorithms/src/components/RangeInput.js b/compare-algorithms/src/components/RangeInput.js index 97e69bf..d90b59a 100644 --- a/compare-algorithms/src/components/RangeInput.js +++ b/compare-algorithms/src/components/RangeInput.js @@ -20,7 +20,7 @@ export class RangeInput extends React.Component { for (min; min <= max; min += step) { arr.push(min) } - return arr.map(val => Math.round(val * 1000) / 1000) + return arr.map(val => Math.round(val * 10000) / 10000) } get length() {