diff --git a/src/pocketpy.h b/src/pocketpy.h index 9749c607..7cca31c6 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -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); });