mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +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
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
Add a link
Reference in a new issue