What's new

Convert to float

M

mojobojo

Enthusiast
Messages
684
Reaction score
96
Points
95
Sin$
7
Im almost done with the Reader class for the Banjo Kazooie N&B Vehicle editor and I need some help on converting to a float. I can only seem to find out how to convert a string to a float. Is there an easier way?
 
D

dschu012

Enthusiast
Frame In Gold Seasoned Veteran
Messages
757
Reaction score
380
Points
125
Sin$
0
Dunno what exactly what you are trying to convert to a float but I will guess a byte array. But try
Code:
float myFloat = BitConverter.ToSingle(byteArray);
 
GoldBl4d3

GoldBl4d3

VIP
VIP
Retired
Programmer Mythical Veteran Legendary Veteran
Messages
3,785
Reaction score
1,452
Points
600
Sin$
0
or if thats not it,

try stuff like

Int32.ConvertTo

or simply

float value = float.Parse(otherValue.ToString());
 
Top Bottom
Login
Register