Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 13 July 2006 - 07:39 AM
Original post by mits
Is there a way to convert a string which represents a float number to a float data type or should I have to write a custom function for that? I want to avoid the trouble. Thanks.
Posted 13 July 2006 - 11:20 AM
Original post by kSquared
You may want to use TryParse() instead, if this is .NET 2.0.
Posted 13 July 2006 - 12:52 PM
string sNum = "123";
float fNum = Convert.ToSingle(sNum);
Posted 13 July 2006 - 01:14 PM
Posted 13 July 2006 - 05:25 PM
Original post by alexmoura
VB calls floats singles (or vice versa), and whoever coded Convert used that name.
It's likely that internally the parse methods use the convert class.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.