mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibJS: Let's show a few more decimals when stringifying numeric values
I'm not sure what the correct behavior is supposed to be, but at least this makes printing numbers show some more interesting detail for now.
This commit is contained in:
parent
c596ef3c0e
commit
ff33c5b286
Notes:
sideshowbarker
2024-07-19 07:41:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ff33c5b2869
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ String Value::to_string() const
|
|||
// FIXME: This needs improvement.
|
||||
if ((double)to_i32() == as_double())
|
||||
return String::number(to_i32());
|
||||
return String::format("%f", as_double());
|
||||
return String::format("%.4f", as_double());
|
||||
}
|
||||
|
||||
if (is_object())
|
||||
|
|
Loading…
Add table
Reference in a new issue