mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
committed by
Andreas Kling
parent
13f5aa81e3
commit
a30e364f1a
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user