mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add locale format
This commit is contained in:
parent
114ba801b9
commit
8cdf12b694
@ -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' },
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user