Update measurement table display text to use cornerstone rendered value fixed points (#1852)
This commit is contained in:
parent
801bf73a34
commit
279d1db997
@ -142,7 +142,7 @@ function PanelMeasurementTableTracking({ servicesManager, extensionManager }) {
|
|||||||
title="Measurements"
|
title="Measurements"
|
||||||
amount={displayMeasurements.length}
|
amount={displayMeasurements.length}
|
||||||
data={displayMeasurements}
|
data={displayMeasurements}
|
||||||
onClick={() => {}}
|
onClick={() => { }}
|
||||||
onEdit={id => alert(`Edit: ${id}`)}
|
onEdit={id => alert(`Edit: ${id}`)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user