Commit 8cdf12b6 by Andrew Prokhorenkov Committed by Carl Bergquist

add locale format

parent 114ba801
......@@ -389,6 +389,10 @@ function($, _) {
return value.toExponential(decimals);
};
kbn.valueFormats.locale = function(value, decimals) {
return value.toLocaleString(undefined, {maximumFractionDigits: decimals});
};
// Currencies
kbn.valueFormats.currencyUSD = kbn.formatBuilders.currency('$');
kbn.valueFormats.currencyGBP = kbn.formatBuilders.currency('£');
......@@ -709,6 +713,7 @@ function($, _) {
{text: 'hexadecimal (0x)', value: 'hex0x' },
{text: 'hexadecimal', value: 'hex' },
{text: 'scientific notation', value: 'sci' },
{text: 'locale format', value: 'locale' },
]
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment