2 <script type="text/javascript">
3 [%# This should use the Format template plugin, but not pushed yet %]
4 [% IF Koha.Preference("CurrencyFormat") == 'FR' %]
17 Number.prototype.format_price = function( value, params ) {
18 params = params == undefined ? {} : params;
19 var thousands_sep = params.thousands_sep == undefined ? default_value.thousands_sep : params.thousands_sep,
20 decimal_point = params.decimal_point == undefined ? default_value.decimal_point : params.decimal_point,
21 //symbol = params.symbol == undefined ? '$' : params.symbol, // Not implemented yet
22 decimal_digits = params.decimal_digits == undefined ? default_value.decimal_digits : params.decimal_digits;
24 var re = '\\d(?=(\\d{' + 3 + '})+' + '\\D' + ')', value = this.toFixed(decimal_digits);
25 return value.replace('.', decimal_point).replace(new RegExp(re, 'g'), '$&' + thousands_sep);