gamma-app-controller 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/application-controller/common.mjs +18 -13
- package/fesm2015/gamma-app-controller.mjs +17 -12
- package/fesm2015/gamma-app-controller.mjs.map +1 -1
- package/fesm2020/gamma-app-controller.mjs +17 -12
- package/fesm2020/gamma-app-controller.mjs.map +1 -1
- package/lib/application-controller/common.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1025,15 +1025,6 @@ class CommonService {
|
|
|
1025
1025
|
return percent * (xMax - xMin) + xMin;
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
ThousandSeparator(value) {
|
|
1029
|
-
if (Number(value)) {
|
|
1030
|
-
if (value > 0 && value < 1) {
|
|
1031
|
-
return value;
|
|
1032
|
-
}
|
|
1033
|
-
return Number(value).toLocaleString();
|
|
1034
|
-
}
|
|
1035
|
-
return value;
|
|
1036
|
-
}
|
|
1037
1028
|
reformatNumberWithThousandSeparator(value) {
|
|
1038
1029
|
if (Number(value)) {
|
|
1039
1030
|
if (value > 0 && value < 1) {
|
|
@@ -1986,11 +1977,11 @@ class CommonService {
|
|
|
1986
1977
|
return result;
|
|
1987
1978
|
return result;
|
|
1988
1979
|
}
|
|
1989
|
-
|
|
1980
|
+
formatNumberWithDecimalPlaces(value, numberOfDigits) {
|
|
1990
1981
|
let val;
|
|
1991
1982
|
const numericValue = Number(value);
|
|
1992
1983
|
if (!isNaN(numericValue)) {
|
|
1993
|
-
val = numericValue.toFixed(
|
|
1984
|
+
val = numericValue.toFixed(numberOfDigits);
|
|
1994
1985
|
}
|
|
1995
1986
|
else {
|
|
1996
1987
|
if (value == "-") {
|
|
@@ -2001,7 +1992,21 @@ class CommonService {
|
|
|
2001
1992
|
return NaN;
|
|
2002
1993
|
}
|
|
2003
1994
|
}
|
|
2004
|
-
|
|
1995
|
+
var parts = val.toString().split(".");
|
|
1996
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1997
|
+
return parts.join(".");
|
|
1998
|
+
}
|
|
1999
|
+
ThousandSeparatorWithTwoDecimals(value) {
|
|
2000
|
+
return this.formatNumberWithDecimalPlaces(value, 2);
|
|
2001
|
+
}
|
|
2002
|
+
ThousandSeparator(value) {
|
|
2003
|
+
if (Number(value)) {
|
|
2004
|
+
if (value > 0 && value < 1) {
|
|
2005
|
+
return value;
|
|
2006
|
+
}
|
|
2007
|
+
return Number(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
2008
|
+
}
|
|
2009
|
+
return value;
|
|
2005
2010
|
}
|
|
2006
2011
|
}
|
|
2007
2012
|
CommonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonService, deps: [{ token: i1.HttpClient }, { token: i3$1.ToastrService }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Injectable });
|