diginext-utils
Version:
README.md
19 lines • 421 B
TypeScript
/**
* Converts a value to an integer.
* Returns 0 if the value cannot be converted.
*
* @param value - The value to convert
* @returns The integer representation
*
* @example
* ```ts
* toInt('42'); // 42
* toInt('3.14'); // 3
* toInt(5.7); // 5
* toInt('hello'); // 0
* toInt(null); // 0
* toInt(''); // 0
* ```
*/
export declare function toInt(value: unknown): number;
//# sourceMappingURL=toInt.d.ts.map