1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

LibJS: Define number_to_string to convert a double to a String

This commit is contained in:
Timothy Flynn 2023-01-13 12:22:20 -05:00 committed by Linus Groh
parent 8a88d4434f
commit 0b58748156
2 changed files with 54 additions and 33 deletions

View file

@ -15,6 +15,7 @@
#include <AK/Forward.h>
#include <AK/Function.h>
#include <AK/Result.h>
#include <AK/String.h>
#include <AK/Types.h>
#include <LibJS/Forward.h>
#include <LibJS/Heap/GCPtr.h>
@ -566,6 +567,7 @@ enum class NumberToStringMode {
WithExponent,
WithoutExponent,
};
ThrowCompletionOr<String> number_to_string(VM& vm, double, NumberToStringMode = NumberToStringMode::WithExponent);
DeprecatedString number_to_deprecated_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
Optional<Value> string_to_number(StringView);