Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 778ad10

Browse files
committed
Merge pull request #149 from mortezag/fixByteX
Fix Byte.ToString(X2)
2 parents c54332c + b46da37 commit 778ad10

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Framework/Subset_of_CorLib/System/Number.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private static String PostProcessInteger(Object value, String original, char for
371371
{
372372
int len = result.Length;
373373

374-
if(value is sbyte)
374+
if(value is sbyte || value is byte)
375375
{
376376
if (len > 2)
377377
{

Test/Platform/Tests/CLR/mscorlib/systemlib/systemlib2/SystemTypeTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public MFTestResults Number_ToString_Test()
6363
// will display its full hex value
6464
bRet &= "FE" == ((sbyte ) -2).ToString("x02");
6565
bRet &= "36" == ((byte ) 0x36).ToString("x02");
66+
bRet &= "FF" == ((byte ) 255).ToString("X2");
6667
bRet &= "FFFD" == ((short ) -3).ToString("x04");
6768
bRet &= "3049" == ((ushort) 0x3049).ToString("x4");
6869
bRet &= "FC00" == ((short ) -1024).ToString("x02");

0 commit comments

Comments
 (0)