2
0
Branimir Karadžić 8 жил өмнө
parent
commit
d73c9517f9
2 өөрчлөгдсөн 11 нэмэгдсэн , 0 устгасан
  1. 3 0
      include/bx/string.h
  2. 8 0
      src/dtoa.cpp

+ 3 - 0
include/bx/string.h

@@ -239,6 +239,9 @@ namespace bx
 	///
 	int32_t toString(char* _out, int32_t _max, uint64_t _value, uint32_t _base = 10);
 
+	///
+	bool fromString(float* _out, const char* _str);
+
 	///
 	bool fromString(double* _out, const char* _str);
 

+ 8 - 0
src/dtoa.cpp

@@ -1042,6 +1042,14 @@ namespace bx
 		return hd.d;
 	}
 
+	bool fromString(float* _out, const char* _str)
+	{
+		double dbl;
+		bool result = fromString(&dbl, _str);
+		*_out = float(dbl);
+		return result;
+	}
+
 	bool fromString(double* _out, const char* _str)
 	{
 		PrepNumber pn;