Skip to content

Commit

Permalink
Make filter values have at least one decimal point so conversions com…
Browse files Browse the repository at this point in the history
…e up more accurately.
  • Loading branch information
eireland committed Feb 7, 2024
1 parent b7d16de commit de437d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/attribute-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export const AttributesSelector = () => {
const fromUnits = dataType.units[units];
const toUnits = dataType.units[newUnits];
if (operator === "between") {
const lowerValue = Math.round(dataType.convertUnits(fromUnits, toUnits, filter.lowerValue.toString()));
const upperValue = Math.round(dataType.convertUnits(fromUnits, toUnits, filter.upperValue.toString()));
const lowerValue = parseFloat((dataType.convertUnits(fromUnits, toUnits, filter.lowerValue.toString())).toFixed(1));
const upperValue = parseFloat((dataType.convertUnits(fromUnits, toUnits, filter.upperValue.toString())).toFixed(1));
return {
...filter,
lowerValue,
upperValue
};
} else if (operator !== "top" && operator !== "bottom" && operator !== "aboveMean" && operator !== "belowMean" && operator !== "all") {
const value = Math.round(dataType.convertUnits(fromUnits, toUnits, filter.value.toString()));
const value = parseFloat((dataType.convertUnits(fromUnits, toUnits, filter.value.toString())).toFixed(1));
return {
...filter,
value
Expand Down

0 comments on commit de437d3

Please sign in to comment.