parent
c154302ece
commit
0adee8fae0
@ -256,22 +256,20 @@ public:
|
|||||||
|
|
||||||
// Float removes 'E' to prevent scientific notation interpretation
|
// Float removes 'E' to prevent scientific notation interpretation
|
||||||
static float value_float() {
|
static float value_float() {
|
||||||
if (value_ptr) {
|
if (!value_ptr) return 0;
|
||||||
char *e = value_ptr;
|
char *e = value_ptr;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const char c = *e;
|
const char c = *e;
|
||||||
if (c == '\0' || c == ' ') break;
|
if (c == '\0' || c == ' ') break;
|
||||||
if (c == 'E' || c == 'e') {
|
if (c == 'E' || c == 'e' || c == 'X' || c == 'x') {
|
||||||
*e = '\0';
|
*e = '\0';
|
||||||
const float ret = strtof(value_ptr, nullptr);
|
const float ret = strtof(value_ptr, nullptr);
|
||||||
*e = c;
|
*e = c;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
++e;
|
|
||||||
}
|
}
|
||||||
return strtof(value_ptr, nullptr);
|
++e;
|
||||||
}
|
}
|
||||||
return 0;
|
return strtof(value_ptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code value as a long or ulong
|
// Code value as a long or ulong
|
||||||
|
Loading…
Reference in New Issue
Block a user