| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |