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