check for null with toLocalString (#14208)

This commit is contained in:
Ryan McKinley 2018-11-28 00:24:59 -08:00 committed by Marcus Efraimsson
parent 2faf8c722f
commit b3e6da0cbd

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 });
};