Skip to content

Commit 1a42e39

Browse files
Copilotjosesimoes
andcommitted
Fix Format_F to handle ToString("F0") for doubles and floats
Co-authored-by: josesimoes <[email protected]>
1 parent 0df37ae commit 1a42e39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CLR/CorLib/corlib_native_System_Number.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,11 @@ int Library_corlib_native_System_Number::Format_F(
752752
}
753753
buffer[ret] = 0;
754754
}
755+
}
755756

757+
// apply negative sign and decimal separator replacements for all types
758+
if (ret > 0)
759+
{
756760
ret = ReplaceNegativeSign(buffer, ret, negativeSign);
757761
ret = ReplaceDecimalSeparator(buffer, ret, decimalSeparator);
758762
}

0 commit comments

Comments
 (0)