mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
AK: Fix printing of negative FixedPoint values
Fixes #17514 by comparing to 0 before truncating the fractional part.
This commit is contained in:
parent
13f5aa81e3
commit
a30e364f1a
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/nico
Commit: a30e364f1a
Pull-request: https://github.com/SerenityOS/serenity/pull/17524
Issue: https://github.com/SerenityOS/serenity/issues/17514
Reviewed-by: https://github.com/gmta ✅
4 changed files with 10 additions and 2 deletions
|
@ -357,6 +357,7 @@ ErrorOr<void> FormatBuilder::put_i64(
|
|||
}
|
||||
|
||||
ErrorOr<void> FormatBuilder::put_fixed_point(
|
||||
bool is_negative,
|
||||
i64 integer_value,
|
||||
u64 fraction_value,
|
||||
u64 fraction_one,
|
||||
|
@ -373,7 +374,6 @@ ErrorOr<void> FormatBuilder::put_fixed_point(
|
|||
StringBuilder string_builder;
|
||||
FormatBuilder format_builder { string_builder };
|
||||
|
||||
bool is_negative = integer_value < 0;
|
||||
if (is_negative)
|
||||
integer_value = -integer_value;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue