Update pocketpy.h

This commit is contained in:
blueloveTH 2022-11-10 13:54:08 +08:00
parent ad23d21297
commit 5765c731a5

View File

@ -175,7 +175,7 @@ void __initializeBuiltinFunctions(VM* _vm) {
_StrStream ss;
ss << std::setprecision(std::numeric_limits<_Float>::max_digits10-1) << val;
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);
});