Skip to content

Commit c599c9e

Browse files
author
Giannis Roussos
committed
Updated Hex string format
1 parent 0ee3492 commit c599c9e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libEDSsharp/extensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class extensions
1818
/// <returns>hexadecimal string representing the value</returns>
1919
public static string ToHexString(this byte val)
2020
{
21-
return String.Format("0x{0:x}", val);
21+
return String.Format("0x{0:X2}", val);
2222
}
2323
/// <summary>
2424
/// returns a string containing the value as hexadecimal
@@ -27,7 +27,7 @@ public static string ToHexString(this byte val)
2727
/// <returns>hexadecimal string representing the value</returns>
2828
public static string ToHexString(this UInt16 val)
2929
{
30-
return String.Format("0x{0:x}",val);
30+
return String.Format("0x{0:X4}",val);
3131
}
3232
/// <summary>
3333
/// returns a string containing the value as hexadecimal
@@ -36,7 +36,7 @@ public static string ToHexString(this UInt16 val)
3636
/// <returns>hexadecimal string representing the value</returns>
3737
public static string ToHexString(this UInt32 val)
3838
{
39-
return String.Format("0x{0:x}", val);
39+
return String.Format("0x{0:X8}", val);
4040
}
4141

4242
}

0 commit comments

Comments
 (0)