mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-12 18:55:09 +00:00
AK: Add String::number() for creating a String from a number.
Instead of manually doing String::format("%d"/"%u") everywhere, let's have
a String API for this. It's just a wrapper around format() for now, but it
could be made more efficient in the future.
This commit is contained in:
@@ -289,7 +289,7 @@ String GVariant::to_string() const
|
||||
case Type::Bool:
|
||||
return as_bool() ? "true" : "false";
|
||||
case Type::Int:
|
||||
return String::format("%d", as_int());
|
||||
return String::number(as_int());
|
||||
case Type::Float:
|
||||
return String::format("%f", (double)as_float());
|
||||
case Type::String:
|
||||
|
||||
Reference in New Issue
Block a user