diff --git a/AK/String.h b/AK/String.h index 42b7a8d58ff..a8471ee4e54 100644 --- a/AK/String.h +++ b/AK/String.h @@ -181,6 +181,10 @@ public: template Optional to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const { +#ifndef KERNEL + if constexpr (IsFloatingPoint) + return StringUtils::convert_to_floating_point(bytes_as_string_view(), trim_whitespace); +#endif if constexpr (IsSigned) return StringUtils::convert_to_int(bytes_as_string_view(), trim_whitespace); else