Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit c72bc00

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
refactor(formatter): keep only Decimal Formatter, delete Number
1 parent 09f3f35 commit c72bc00

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/app/examples/grid-formatter.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class GridFormatterComponent implements OnInit {
2828
this.columnDefinitions = [
2929
{ id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, width: 70 },
3030
{ id: 'phone', name: 'Phone Number using mask', field: 'phone', sortable: true, type: FieldType.number, minWidth: 100, formatter: Formatters.mask, params: { mask: '(000) 000-0000' } },
31-
{ id: 'duration', name: 'Duration (days)', field: 'duration', formatter: Formatters.decimal, params: { decimalPlaces: 2 }, sortable: true, type: FieldType.number, minWidth: 90 },
31+
{ id: 'duration', name: 'Duration (days)', field: 'duration', formatter: Formatters.decimal, params: { minDecimalPlaces: 1, maxDecimalPlaces: 2 }, sortable: true, type: FieldType.number, minWidth: 90 },
3232
{ id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true, minWidth: 100 },
3333
{ id: 'percent2', name: '% Complete', field: 'percentComplete2', formatter: Formatters.progressBar, type: FieldType.number, sortable: true, minWidth: 100 },
3434
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, minWidth: 90, exportWithFormatter: true },

src/app/modules/angular-slickgrid/formatters/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ export const Formatters = {
133133
*/
134134
multiple: multipleFormatter,
135135

136-
/** alias of the decimal formatter */
137-
number: decimalFormatter,
138-
139136
/** Takes a cell value number (between 0.0-1.0) and displays a red (<50) or green (>=50) bar */
140137
percent: percentFormatter,
141138

0 commit comments

Comments
 (0)