Fix the case where eout % 3 produces a negative value

This commit is contained in:
Austin Putland 2023-06-21 16:41:52 -03:00
commit 5ed7e55d65

View file

@ -1171,7 +1171,7 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, NumberFormat format, uint32_t radi
{
if (format == NumberFormat::Engineering)
{
exponent = (eout % 3);
exponent = (3 + (eout % 3)) % 3;
eout -= exponent;
exponent++;