/// <summary>Convert float to String Hex</summary> /// <param name="value">The float value</param> /// <returns>Returns an hex string value</returns> public static string ToHexString(float value) { try { return(ToHexString(ToByteArray.Single(value))); } catch (Exception exception) { throw new Exception(exception.Message); } }
/// <summary>Convert a decimal value to 4 bytes hex string</summary> /// <param name="value">The value to convert</param> /// <returns>The hex string</returns> public static string ToHexString4Bytes(Decimal value) { try { byte[] output = ToByteArray.Decimal4Bytes(value); return(ToHexString(output)); } catch (Exception exception) { throw new Exception(exception.Message); } }
/// <summary>Convert Long to String Hex</summary> /// <param name="value">The byte array</param> /// <returns>Returns an hex string value</returns> public static string ToHexString(long value) { try { byte[] buffer = ToByteArray.Int64(value); return(BitConverter.ToString(buffer).Replace("-", "")); } catch (Exception exception) { throw new Exception(exception.Message); } }