Browse Source

Update pocketpy.h

blueloveTH 3 years ago
parent
commit
5765c731a5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pocketpy.h

+ 1 - 1
src/pocketpy.h

@@ -175,7 +175,7 @@ void __initializeBuiltinFunctions(VM* _vm) {
         _StrStream ss;
         _StrStream ss;
         ss << std::setprecision(std::numeric_limits<_Float>::max_digits10-1) << val;
         ss << std::setprecision(std::numeric_limits<_Float>::max_digits10-1) << val;
         std::string s = ss.str();
         std::string s = ss.str();
-        if(s.find('.') == std::string::npos) s += ".0";
+        if(std::all_of(s.begin(), s.end(), isdigit)) s += ".0";
         return vm->PyStr(s);
         return vm->PyStr(s);
     });
     });