From Clomosy Docs

(Created page with " function FloatToStr(Value Extended):string; The FloatToStr function converts a floating point number Value into a displayable string. The value is displayed to 15 digits of precision. The Value type may be any of the floating point types.<br> '''Example:'''<br> '''var''' LongNumberValue, ShortNumberValue : float;<br> '''begin''' LongNumberValue := 1234567890.123456789; ShortNumberValue := 123.12;<br> ShowMessage('LongNumberValue = '+'''FloatToStr'''(Long...")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
function FloatToStr(Value Extended):string;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function FloatToStr(Value: Extended):string;
</div>
 
The FloatToStr function converts a floating point number Value into a displayable string. The value is displayed to 15 digits of precision. The Value type may be any of the floating point types.<br>
The FloatToStr function converts a floating point number Value into a displayable string. The value is displayed to 15 digits of precision. The Value type may be any of the floating point types.<br>


'''Example:'''<br>
<b>Example</b><br>
 
<pre>
var
  LongNumberValue, ShortNumberValue : float;
{
  LongNumberValue = 1234567890.123456789;
  ShortNumberValue = 123.12;
  ShowMessage('LongNumberValue = '+FloatToStr(LongNumberValue));
  ShowMessage('ShortNumberValue = '+FloatToStr(ShortNumberValue));
}


'''var'''
</pre>
  LongNumberValue, ShortNumberValue : float;<br>
'''begin'''
  LongNumberValue := 1234567890.123456789;
  ShortNumberValue := 123.12;<br>
  ShowMessage('LongNumberValue = '+'''FloatToStr'''(LongNumberValue));
  ShowMessage('ShortNumberValue = '+'''FloatToStr'''(ShortNumberValue));
'''end;'''


'''Output:'''<br>
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
LongNumberValue = 1234567890,123456789<br>
ShortNumberValue = 123,12
</div>


LongNumberValue = 1234567890,123456789
<h2> See Also </h2>
ShortNumberValue = 123,12
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
{{#seo:|title=FloatToStr Using in Clomosy - Clomosy Docs}}
{{#seo:|description=Use FloatToStr in Clomosy to convert a floating-point number to a string with up to 15 digits of precision for accurate display.}}

Latest revision as of 14:09, 24 December 2024

The FloatToStr function converts a floating point number Value into a displayable string. The value is displayed to 15 digits of precision. The Value type may be any of the floating point types.

Example

 var
   LongNumberValue, ShortNumberValue : float;
 
 {
   LongNumberValue = 1234567890.123456789;
   ShortNumberValue = 123.12;
 
   ShowMessage('LongNumberValue = '+FloatToStr(LongNumberValue));
   ShowMessage('ShortNumberValue = '+FloatToStr(ShortNumberValue));
 }

Output:

See Also