mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-11 02:29:54 +05:30
fix: containsOnlyDigits (remove minus)
This commit is contained in:
parent
674c587bd0
commit
890005f77c
1 changed files with 2 additions and 2 deletions
|
|
@ -41,8 +41,8 @@ export function reverseString(input: string): string {
|
||||||
/**
|
/**
|
||||||
* Checks if the input string contains only digits.
|
* Checks if the input string contains only digits.
|
||||||
* @param input - The string to validate.
|
* @param input - The string to validate.
|
||||||
* @returns True if the input contains only digits, false otherwise.
|
* @returns True if the input contains only digits including float, false otherwise.
|
||||||
*/
|
*/
|
||||||
export function containsOnlyDigits(input: string): boolean {
|
export function containsOnlyDigits(input: string): boolean {
|
||||||
return /^-?\d+(\.\d+)?$/.test(input.trim());
|
return /^\d+(\.\d+)?$/.test(input.trim());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue