Based on this , you can use a format string such as:
yaxis: {
tickOptions: { formatString: "%'.2f" },
min : 0
}
This format string along with the value ends with the arguments in the call $.jqplot.sprintf. Then you can set the delimiters as follows:
$.jqplot.sprintf.thousandsSeparator = ',';
$.jqplot.sprintf.decimalMark = '.';
So this code:
var value = 10000;
$.jqplot.sprintf.thousandsSeparator = '.';
$.jqplot.sprintf.decimalMark = ',';
console.log($.jqplot.sprintf("European %'.2f", value));
$.jqplot.sprintf.thousandsSeparator = ' ';
$.jqplot.sprintf.decimalMark = ',';
console.log($.jqplot.sprintf("Other %'.2f", value));
$.jqplot.sprintf.thousandsSeparator = ',';
$.jqplot.sprintf.decimalMark = '.';
console.log($.jqplot.sprintf("US %'.2f", value));
Let's do this:
European 10,000.00
Other 10 000,00
US 10,000.00
, , ? , , : , .
- , " ", :
yaxis: {
tickOptions: {
tickOptions: { formatString: "%'.2f" },
formatter: function(format, value){
return FormatTick(format, value);
}
}
}
....
function FormatTick(format, value) {
var prevThousandsSeparator = $.jqplot.sprintf.thousandsSeparator;
var prevDecimalMark = $.jqplot.sprintf.decimalMark;
$.jqplot.sprintf.thousandsSeparator = '#';
$.jqplot.sprintf.decimalMark = '_';
var formattedValue = $.jqplot.sprintf(format, value);
formattedValue = formattedValue.replace($.jqplot.sprintf.decimalMark, Language.DecimalMark)
.replace($.jqplot.sprintf.thousandsSeparator, Language.ThousandsSeparator);
$.jqplot.sprintf.thousandsSeparator = prevThousandsSeparator;
$.jqplot.sprintf.decimalMark = prevDecimalMark;
return formattedValue;
}
, , . thousandsSeparator decimalMark , , .
, , # _ , . , FormatTick - .