[ML] Fixes display of regression stop stats if one is NaN (#72412)

This commit is contained in:
Pete Harverson 2020-07-20 16:12:57 +01:00 committed by GitHub
parent e5c7e9a474
commit 66208fb73e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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