check for null with toLocalString (#14208)
(cherry picked from commit b3e6da0cbd)
This commit is contained in:
@@ -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 });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user