From Clomosy Docs

No edit summary
No edit summary
 
Line 29: Line 29:
<h2> See Also </h2>
<h2> See Also </h2>
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
{{#seo:|title=StrToFloat Using in Clomosy - Clomosy Docs}}
{{#seo:|description=Use StrToFloat in Clomosy to convert a number string into a floating-point value, supporting various formats.}}
{{#seo:|description=Use StrToFloat in Clomosy to convert a number string into a floating-point value, supporting various formats.}}

Latest revision as of 14:22, 24 December 2024

The StrToFloat function converts a number string, FloatString such as '123,456' into an Extended floating point number. It supports integer, floating point, and scientific (exponent) formats.

Example

 var
   stringValue : string;
   floatValue  : float;
 
 {
   // Set up the source string containing a number representation
   stringValue = '123,456';
   // Convert it to a floating point number
   floatValue  = StrToFloat(stringValue);
   // And display the value
   ShowMessage(stringValue+' = '+FloatToStr(floatValue));
 }

Output:

See Also