LSIsNumeric()
Determines whether a string is a valid representation of a number in the current locale.
LSIsNumeric( number=string, locale=locale );
Returns: Boolean
| Argument | Description |
|---|---|
|
number
string,
required
|
edit
A string or a variable that contains one Alias: string |
|
locale
locale,
optional
|
edit
Locale to use instead of the locale of the page when processing the function |
Examples
edit writeoutput(lsIsNumeric('123') & "<br>");
writeoutput(lsIsNumeric('five') & "<br>");
writeoutput(lsIsNumeric('3.21') & "<br>");
writeoutput(lsIsNumeric('0012') & "<br>");
writeoutput(lsIsNumeric('00.01'));
writeoutput(lsIsNumeric('1.321,00') & "<br>"); // false
writeoutput(lsIsNumeric('1.321,00', "german") & "<br>"); // true
See also
- Decision logic
- Internationalization
- Numbers
- IsNumeric()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)