From 7fd108d4d5c87adcf60cfe45101cad8ef06a780c Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Mon, 20 Jul 2020 21:48:37 +0100 Subject: [PATCH] [ML] Fixes display of regression stop stats if one is NaN (#72412) (#72457) --- .../public/application/data_frame_analytics/common/analytics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts index 06254f0de092e..561e8642772f0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts @@ -446,7 +446,7 @@ export function getValuesFromResponse(response: RegressionEvaluateResponse) { if (response.regression.hasOwnProperty(statType)) { let currentStatValue = response.regression[statType as keyof RegressionEvaluateResponse['regression']]?.value; - if (currentStatValue) { + if (currentStatValue && !isNaN(currentStatValue)) { currentStatValue = Number(currentStatValue.toPrecision(DEFAULT_SIG_FIGS)); } results[statType as keyof RegressionEvaluateExtractedResponse] = currentStatValue;