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

@ -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;