spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * String functions

AsFloat property

readonly float String.AsFloat;
Converts the string into a float, and returns that value. Returns 0.0 if the string does not contain a number.

Example:

String text1, text2;
float number1,number2;
text1 = "57.362";
text2 = "Hello";
number1 = text1.AsFloat;
number2 = text2.AsFloat;
will set number1 value to 57.362 and number2 value to 0.0 This function is useful for processing strings input from the user.

NOTE: To convert a float to a string, you can use the String.Format command.

See Also: Game.InputBox, String.AsInt, String.Format


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.