aboutsummarylogtreecommitdiffstats
path: root/string-tick.c
diff options
context:
space:
mode:
Diffstat (limited to 'string-tick.c')
-rw-r--r--string-tick.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/string-tick.c b/string-tick.c
index b916657c2ef6..5ddf41373cd6 100644
--- a/string-tick.c
+++ b/string-tick.c
@@ -100,4 +100,16 @@ int is_string_json_array(const String* pString) {
int formatted = jobj != NULL && json_object_is_type(jobj, json_type_array);
json_object_put(jobj);
return formatted;
+}
+
+int is_str_number(const char* string) {
+ size_t len = strlen(string);
+ if (len == 0)
+ return 0;
+
+ for (size_t i = 0; i < len; i++)
+ if (!isdigit(string[i]))
+ return 0;
+
+ return 1;
} \ No newline at end of file