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

This commit is contained in:
Igor Octaviano authored and GitHub committed 2020-07-02 10:12:10 -04:00
1 parent 801bf73a34
commit 279d1db997
1 file changed
+4 -4
@@ -142,7 +142,7 @@ function PanelMeasurementTableTracking({ servicesManager, extensionManager }) {
title="Measurements"
amount={displayMeasurements.length}
data={displayMeasurements}
onClick={() => {}}
onClick={() => { }}
onEdit={id => alert(`Edit: ${id}`)}
/>
</div>
@@ -226,7 +226,7 @@ function _getDisplayText(
switch (type) {
case types.POLYLINE: {
const { length } = measurement;
const roundedLength = _round(length, 1);
const roundedLength = _round(length, 2);
return [
`${roundedLength} ${unit} (S:${seriesNumber}, I:${instanceNumber})`,
@@ -244,7 +244,7 @@ function _getDisplayText(
}
case types.ELLIPSE: {
const { area } = measurement;
const roundedArea = _round(area, 1);
const roundedArea = _round(area, 2);
return [
`${roundedArea} ${unit}2 (S:${seriesNumber}, I:${instanceNumber})`,
@@ -258,7 +258,7 @@ function _getDisplayText(
}
function _round(value, decimals) {
return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
return parseFloat(value).toFixed(decimals);
}
export default PanelMeasurementTableTracking;