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

Commit 35b8750

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
fix(formatters): some formatters were not considering empty string
1 parent 9f6191c commit 35b8750

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Column, Formatter } from './../models/index';
22
import { decimalFormatted } from './../services/utilities';
33

44
export const boldFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) => {
5-
const isNumber = (value === null || value === undefined) ? false : !isNaN(+value);
5+
const isNumber = (value === null || value === undefined || value === '') ? false : !isNaN(+value);
66
if (!isNumber) {
77
return '';
88
} else if (value >= 0) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const decimalFormatter: Formatter = (row: number, cell: number, value: an
55
const params = columnDef.params || {};
66
const minDecimalPlaces = (params.minDecimalPlaces !== null && params.minDecimalPlaces) || (params.decimalPlaces !== null && params.decimalPlaces) || 2;
77
const maxDecimalPlaces = (params.maxDecimalPlaces !== null && params.maxDecimalPlaces) || 2;
8-
const isNumber = (value === null || value === undefined) ? false : !isNaN(+value);
8+
const isNumber = (value === null || value === undefined || value === '') ? false : !isNaN(+value);
99

1010
return !isNumber ? value : `${decimalFormatted(value, minDecimalPlaces, maxDecimalPlaces)}`;
1111
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Column, Formatter } from './../models/index';
22
import { decimalFormatted } from './../services/utilities';
33

44
export const dollarColoredBoldFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) => {
5-
const isNumber = (value === null || value === undefined) ? false : !isNaN(+value);
5+
const isNumber = (value === null || value === undefined || value === '') ? false : !isNaN(+value);
66
const params = columnDef && columnDef.params || {};
77
const minDecimal = params.minDecimal || 2;
88
const maxDecimal = params.minDecimal || 4;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Column, Formatter } from './../models/index';
22
import { decimalFormatted } from './../services/utilities';
33

44
export const dollarColoredFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) => {
5-
const isNumber = (value === null || value === undefined) ? false : !isNaN(+value);
5+
const isNumber = (value === null || value === undefined || value === '') ? false : !isNaN(+value);
66
const params = columnDef && columnDef.params || {};
77
const minDecimal = params.minDecimal || 2;
88
const maxDecimal = params.minDecimal || 4;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Column, Formatter } from './../models/index';
22
import { decimalFormatted } from './../services/utilities';
33

44
export const dollarFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) => {
5-
const isNumber = (value === null || value === undefined) ? false : !isNaN(+value);
5+
const isNumber = (value === null || value === undefined || value === '') ? false : !isNaN(+value);
66
const params = columnDef && columnDef.params || {};
77
const minDecimal = params.minDecimal || 2;
88
const maxDecimal = params.minDecimal || 4;

0 commit comments

Comments
 (0)