ts-commons
Advanced tools
Comparing version 1.0.21 to 1.0.22
@@ -35,2 +35,9 @@ export declare class NumberUtils { | ||
static isSafeInteger(value: any): boolean; | ||
/** | ||
* Returns a string representing a number in fixed-point notation. | ||
* @param value target value. | ||
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. | ||
* @param defaultValue default value if value is empty. | ||
*/ | ||
static toFixed(value: number, fractionDigits: number, defaultValue?: string): string; | ||
} |
@@ -45,2 +45,14 @@ "use strict"; | ||
}; | ||
/** | ||
* Returns a string representing a number in fixed-point notation. | ||
* @param value target value. | ||
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. | ||
* @param defaultValue default value if value is empty. | ||
*/ | ||
NumberUtils.toFixed = function (value, fractionDigits, defaultValue) { | ||
if (object_utils_1.ObjectUtils.isNullOrUndefined(value)) { | ||
return object_utils_1.ObjectUtils.getOrDefault(defaultValue, ""); | ||
} | ||
return value.toFixed(fractionDigits); | ||
}; | ||
NumberUtils.MAX_SAFE_INTEGER = 9007199254740991; | ||
@@ -47,0 +59,0 @@ NumberUtils.MIN_SAFE_INTEGER = -9007199254740991; |
{ | ||
"name": "ts-commons", | ||
"version": "1.0.21", | ||
"version": "1.0.22", | ||
"description": "common methods for typescript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
202485
2106
1