Update measurement table display text to use cornerstone rendered value fixed points (#1852)

This commit is contained in:
Igor Octaviano 2020-07-02 11:12:10 -03:00 committed by GitHub
parent 801bf73a34
commit 279d1db997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,7 +226,7 @@ function _getDisplayText(
switch (type) { switch (type) {
case types.POLYLINE: { case types.POLYLINE: {
const { length } = measurement; const { length } = measurement;
const roundedLength = _round(length, 1); const roundedLength = _round(length, 2);
return [ return [
`${roundedLength} ${unit} (S:${seriesNumber}, I:${instanceNumber})`, `${roundedLength} ${unit} (S:${seriesNumber}, I:${instanceNumber})`,
@ -244,7 +244,7 @@ function _getDisplayText(
} }
case types.ELLIPSE: { case types.ELLIPSE: {
const { area } = measurement; const { area } = measurement;
const roundedArea = _round(area, 1); const roundedArea = _round(area, 2);
return [ return [
`${roundedArea} ${unit}2 (S:${seriesNumber}, I:${instanceNumber})`, `${roundedArea} ${unit}2 (S:${seriesNumber}, I:${instanceNumber})`,
@ -258,7 +258,7 @@ function _getDisplayText(
} }
function _round(value, decimals) { function _round(value, decimals) {
return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); return parseFloat(value).toFixed(decimals);
} }
export default PanelMeasurementTableTracking; export default PanelMeasurementTableTracking;