Skip to content

Commit

Permalink
fix negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
Cholgrrr authored and rruhdorfer committed Oct 8, 2024
1 parent e56b401 commit 8d0d389
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# v2.0.0

- Updates @vcmap/core and @vcmap/ui to verison 6.0
- Updates @vcmap/core and @vcmap/ui to version 6.0
- Fixes 3D Height sketch theme to match dark mode
- Fixes Issue with negative Values

# v1.0.8

Expand Down
5 changes: 4 additions & 1 deletion src/mode/measurementMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ class MeasurementMode {
abs /= cutoff;
unit = `k${unit}`;
}
return `${abs.toFixed(this.decimalPlaces)} ${unit}`;

const formattedValue =
(value < 0 ? '-' : '') + abs.toFixed(this.decimalPlaces);
return `${formattedValue} ${unit}`;
}

// eslint-disable-next-line class-methods-use-this
Expand Down

0 comments on commit 8d0d389

Please sign in to comment.