2 <!-- format-price.inc -->
4 [%# This should use the Format template plugin, but not pushed yet %]
5 [% IF Koha.Preference("CurrencyFormat") == 'FR' %]
11 [% ELSIF Koha.Preference("CurrencyFormat") == 'CH' %]
25 Number.prototype.format_price = function( value, params ) {
26 params = params == undefined ? {} : params;
27 var thousands_sep = params.thousands_sep == undefined ? default_value.thousands_sep : params.thousands_sep,
28 decimal_point = params.decimal_point == undefined ? default_value.decimal_point : params.decimal_point,
29 //symbol = params.symbol == undefined ? '$' : params.symbol, // Not implemented yet
30 decimal_digits = params.decimal_digits == undefined ? default_value.decimal_digits : params.decimal_digits;
32 var re = '\\d(?=(\\d{' + 3 + '})+' + '\\D' + ')', value = this.toFixed(decimal_digits);
33 return value.replace('.', decimal_point).replace(new RegExp(re, 'g'), '$&' + thousands_sep);
36 <!-- / format-price.inc -->