diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts index 153ff66..d06ed94 100644 --- a/src/components/Table/index.ts +++ b/src/components/Table/index.ts @@ -135,7 +135,7 @@ export const makeTextColumn = ( ...other }) -const defaultNumericRender = (value: any, row: object) => { +export const defaultNumericRender = (value: any, row: object) => { const placeholder = '-' if((value === null) || (value === undefined) || diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 6517219..d6f93cd 100644 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -8,7 +8,8 @@ import { makeColumn, numericColumnOptions, makeNumericSorter, - makeDateSorter } from "../../components/Table" + makeDateSorter, + defaultNumericRender } from "../../components/Table" import LoaderPortal from '../../components/LoaderPortal' import { invokeWebApiWrapperAsync } from '../../components/factory' import { WellOperationService} from '../../services/api' @@ -30,10 +31,7 @@ const numericSortColumnOptions = { const durationFormattedColumnOptions = { ...numericColumnOptions, - render:(value) => -
- {Number.isNaN(+value) ? "-" : value.toFixed(2)} -
+ render: defaultNumericRender } export const WellOperationsEditor = ({idWell, idType}) => {