util-ex
Version:
Browser-friendly enhanced util fully compatible with standard node.js
14 lines (13 loc) • 510 B
TypeScript
/**
* Checks if a string represents a valid floating point number.
* @param {string} str The string to test.
* @returns {boolean} `true` if the string represents a valid floating point number, `false` otherwise.
* @example
* isFloatStr('3.14'); // returns true
* isFloatStr('-0.5'); // returns true
* isFloatStr('2.718e0'); // returns true
* isFloatStr('2.718e-2'); // returns true
* isFloatStr('abc'); // returns false
*/
export function isFloatStr(str: string): boolean;
export default isFloatStr;