Hex String To Float - CSharp System

CSharp examples for System:Hex

Description

Hex String To Float

Demo Code

// Licensed under the GPL license.
using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*w w w .j a  v a  2  s. c om*/

public class Main{
        public static float HexStringToFloat(string pvVal)
        {
            int discarded = 0;
            return BitConverter.ToSingle(ReverseBytes(GetBytes(pvVal, out discarded)), 0);
        }
}

Related Tutorials