We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 008b96a commit 989d6c1Copy full SHA for 989d6c1
src/scratch/value.h
@@ -323,9 +323,19 @@ class LIBSCRATCHCPP_EXPORT Value : public ValueVariant
323
}
324
325
bool ok;
326
- double d = stringToDouble(str, &ok);
+ bool isLong = false;
327
+ long l;
328
+ double d;
329
+ if ((str.find_first_of('.') == std::string::npos) && (str.find_first_of('e') == std::string::npos) && (str.find_first_of('E') == std::string::npos)) {
330
+ l = stringToLong(str, &ok);
331
+ isLong = true;
332
+ } else
333
+ d = stringToDouble(str, &ok);
334
if (ok) {
- *this = d;
335
+ if (isLong)
336
+ *this = l;
337
+ else
338
+ *this = d;
339
m_type = Type::Number;
340
341
0 commit comments