Skip to content

Commit 37a3686

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

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

libEDSsharp/CanOpenXDD_1_1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ private ISO15745ProfileContainer Convert(EDSsharp eds, string fileName, bool dev
954954
body_device.DeviceIdentity = new DeviceIdentity();
955955
body_device.DeviceIdentity.vendorName = new vendorName { Value = eds.di.VendorName };
956956
body_device.DeviceIdentity.vendorID = new vendorID { Value = eds.di.VendorNumber.ToHexString() };
957-
body_device.DeviceIdentity.specificationRevision = new specificationRevision { Value = eds.di.RevisionNumber.ToString() };
957+
body_device.DeviceIdentity.specificationRevision = new specificationRevision { Value = eds.di.RevisionNumber.ToHexString() };
958958
body_device.DeviceIdentity.orderNumber = new orderNumber[] { new orderNumber { Value = eds.di.OrderCode } };
959959
body_device.DeviceIdentity.productName = new productName { Value = eds.di.ProductName };
960960
body_device.DeviceIdentity.productID = new productID { Value = eds.di.ProductNumber.ToHexString() };

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)