fooplugins / FooTable

jQuery plugin to make HTML tables responsive
https://fooplugins.com/plugins/footable-jquery/
Other
2.13k stars 640 forks source link

Thousands comma separator not showing #894

Open atoohill opened 1 year ago

atoohill commented 1 year ago

When I define data-type="number" the comma is removed from the thousands separator in the output.

Trying to figure out how to have the comma included.

otovalek commented 1 year ago

There is is bug at https://github.com/fooplugins/FooTable/blob/fba11d1d8ad4eb61913c7538b26283eab2d9d777/src/js/classes/columns/FooTable.NumberColumn.js#L55

895 fixes it.

A workaround is to define a custom formatter for the column:

"formatter": function(value, options, rowData) {
                 if (value == null) return '';
                 var s = (value + '').split('.');
                 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, this.thousandSeparator);
                 return s.join(this.decimalSeparator);
             }
atoohill commented 1 year ago

@otovalek - we need some assistance to implement this workaround. How can I discuss with you privately?