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
|
@@ -1030,15 +1030,6 @@ class CommonService {
|
|
|
1030
1030
|
return percent * (xMax - xMin) + xMin;
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
|
-
ThousandSeparator(value) {
|
|
1034
|
-
if (Number(value)) {
|
|
1035
|
-
if (value > 0 && value < 1) {
|
|
1036
|
-
return value;
|
|
1037
|
-
}
|
|
1038
|
-
return Number(value).toLocaleString();
|
|
1039
|
-
}
|
|
1040
|
-
return value;
|
|
1041
|
-
}
|
|
1042
1033
|
reformatNumberWithThousandSeparator(value) {
|
|
1043
1034
|
if (Number(value)) {
|
|
1044
1035
|
if (value > 0 && value < 1) {
|
|
@@ -1991,11 +1982,11 @@ class CommonService {
|
|
|
1991
1982
|
return result;
|
|
1992
1983
|
return result;
|
|
1993
1984
|
}
|
|
1994
|
-
|
|
1985
|
+
formatNumberWithDecimalPlaces(value, numberOfDigits) {
|
|
1995
1986
|
let val;
|
|
1996
1987
|
const numericValue = Number(value);
|
|
1997
1988
|
if (!isNaN(numericValue)) {
|
|
1998
|
-
val = numericValue.toFixed(
|
|
1989
|
+
val = numericValue.toFixed(numberOfDigits);
|
|
1999
1990
|
}
|
|
2000
1991
|
else {
|
|
2001
1992
|
if (value == "-") {
|
|
@@ -2006,7 +1997,21 @@ class CommonService {
|
|
|
2006
1997
|
return NaN;
|
|
2007
1998
|
}
|
|
2008
1999
|
}
|
|
2009
|
-
|
|
2000
|
+
var parts = val.toString().split(".");
|
|
2001
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
2002
|
+
return parts.join(".");
|
|
2003
|
+
}
|
|
2004
|
+
ThousandSeparatorWithTwoDecimals(value) {
|
|
2005
|
+
return this.formatNumberWithDecimalPlaces(value, 2);
|
|
2006
|
+
}
|
|
2007
|
+
ThousandSeparator(value) {
|
|
2008
|
+
if (Number(value)) {
|
|
2009
|
+
if (value > 0 && value < 1) {
|
|
2010
|
+
return value;
|
|
2011
|
+
}
|
|
2012
|
+
return Number(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
2013
|
+
}
|
|
2014
|
+
return value;
|
|
2010
2015
|
}
|
|
2011
2016
|
}
|
|
2012
2017
|
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 });
|