diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 2d8f0a4..4db7c1f 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -13,10 +13,10 @@ export const formatDate='YYYY.MM.DD HH:mm' export const makeNumericRender = (fixed?:number) => (value: any, row: object): ReactNode => { const placeholder = '-' let val = placeholder - if((value !== null) || - (value !== undefined) || - Number.isNaN(value) || - !Number.isFinite(value)){ + if((value !== null) && + (value !== undefined) && + !Number.isNaN(value) && + Number.isFinite(value)){ val = !!fixed ? (+value).toFixed(fixed) : (+value).toPrecision(5) diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index f986c13..8d3a053 100644 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -9,7 +9,7 @@ import { makeColumn, makeDateSorter, makeNumericColumnPlanFact} from '../../components/Table' -import { calcAndUpdateStatsBySections, makeFilterMinMaxFunction, getPrecision } from './functions' +import { calcAndUpdateStatsBySections, makeFilterMinMaxFunction } from './functions' import { invokeWebApiWrapperAsync } from '../../components/factory' import { Tvd } from '../WellOperations/Tvd' import WellOperationsTable from './WellOperationsTable' @@ -98,10 +98,10 @@ export default function ClusterWells({statsWells}) { makeColumn('начало', 'factStart', { sorter: makeDateSorter('factStart'), render: getDate }), makeColumn('окончание', 'factEnd', { sorter: makeDateSorter('factEnd'), render: getDate }) ]), - makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax, makeFilterMinMaxFunction, getPrecision), - makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax, makeFilterMinMaxFunction, getPrecision), - makeNumericColumnPlanFact('Рейсовая скорость', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction, getPrecision), - makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax, makeFilterMinMaxFunction, getPrecision), + makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax, makeFilterMinMaxFunction), + makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax, makeFilterMinMaxFunction), + makeNumericColumnPlanFact('Рейсовая скорость', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction), + makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax, makeFilterMinMaxFunction), { title: 'TVD', key: 'tvd',