Cicode Programming Reference > Cicode Function Categories > String Functions > RealToStr

RealToStr

Converts a floating-point number into a string.

Syntax

RealToStr(Number, Width, Places[, Separator])

Number:

The floating-point number to convert.

Width:

The width of the string.

Places:

The number of decimal places contained in the string.

Separator:

Optionally, the decimal separator contained in the string. Defaults to empty string.

"." - period

"," - comma

"" - empty string

If an empty string or an invalid separator is passed as a parameter, the string will contain the decimal separator used in the current locale.

Return Value

The floating-point number (as a string).

Related Functions

StrToReal

Example

Variable=RealToStr(12.345,10,1);
! Sets Variable to " 12.3" (10 characters long).

See Also

String Functions

Published June 2018