check for null with toLocalString (#14208)

(cherry picked from commit b3e6da0cbd)
This commit is contained in:
Ryan McKinley
2018-11-28 10:23:43 +01:00
committed by Marcus Efraimsson
parent fd3821d2f1
commit bb4e5934fb
+6
View File
@@ -428,10 +428,16 @@ kbn.valueFormats.hex0x = (value, decimals) => {
};
kbn.valueFormats.sci = (value, decimals) => {
if (value == null) {
return '';
}
return value.toExponential(decimals);
};
kbn.valueFormats.locale = (value, decimals) => {
if (value == null) {
return '';
}
return value.toLocaleString(undefined, { maximumFractionDigits: decimals });
};