mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
AK: Add float support for JsonValue and JsonObjectSerializer
This commit is contained in:
parent
ae1cd4b448
commit
73ade62d4f
Notes:
sideshowbarker
2024-07-17 17:46:31 +09:00
Author: https://github.com/MichielVrins
Commit: 73ade62d4f
Pull-request: https://github.com/SerenityOS/serenity/pull/12793
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/drunderscore
Reviewed-by: https://github.com/linusg
2 changed files with 13 additions and 3 deletions
|
@ -170,6 +170,16 @@ public:
|
|||
}
|
||||
|
||||
#ifndef KERNEL
|
||||
ErrorOr<void> add(StringView key, float value)
|
||||
{
|
||||
TRY(begin_item(key));
|
||||
if constexpr (IsLegacyBuilder<Builder>)
|
||||
TRY(m_builder.try_appendff("{}", value));
|
||||
else
|
||||
TRY(m_builder.appendff("{}", value));
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> add(StringView key, double value)
|
||||
{
|
||||
TRY(begin_item(key));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue