From bf9d34357017b5989ad87dc77152e03f111aa494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Sun, 29 Aug 2021 12:14:10 +0500 Subject: [PATCH] fix NaN in WellSectionsStat --- src/pages/WellOperations/WellSectionsStat.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index 6ca03fe..8c89d18 100644 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -4,7 +4,12 @@ import { invokeWebApiWrapperAsync } from '../../components/factory' import { Table, makeColumn, makeColumnsPlanFact } from '../../components/Table' import { WellOperationStatService } from '../../services/api' -const makeNumberRender = (format) => ((value) => (+value).toFixed(format)) +const makeNumberRender = format => value => { + const v = +value + if(Number.isFinite(v)) + return v.toFixed(format) + return '-' +} const columns = [ makeColumn('Тип секции','sectionType'),