summaryrefslogtreecommitdiffstats
path: root/src/StringUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/StringUtils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp
index b1f58f23c..ae0aec1ad 100644
--- a/src/StringUtils.cpp
+++ b/src/StringUtils.cpp
@@ -1051,3 +1051,15 @@ AString StringsConcat(const AStringVector & a_Strings, char a_Separator)
}
return res;
}
+
+bool StringToFloat(const AString & a_String, float & a_Num)
+{
+ char *err;
+ a_Num = strtof(a_String.c_str(), &err);
+ if (*err != 0)
+ {
+ return false;
+ }
+ return true;
+}
+