AsString Function

Top  Previous  Next

Displays the given expression as a string.

 

Syntax

 

stringVariable = AsString( expression, [ decimals ], [addCommas] )

 

Parameters

expression

 

the expression to convert

decimals

 

optional number of decimals to display

addCommas

 

optional true/false to include commas in the number

 

 

 

returns

 

the converted expression

 

 

Example

 

VARIABLES: integerOne, integerTwo TYPE: INTEGER

 

integerOne = 123

integerTwo = 456

 

PRINT integerOne + integerTwo

' This prints "579"

 

PRINT AsString(integerOne) + AsString(integerTwo)

' This prints "123456"

 

Example

 

VARIABLES: floatVar TYPE: FLOATING

 

floatVar = 123.456789

 

PRINT AsString( floatVar, 2 )

 

' This prints "123.45"

 

 

 

VARIABLES: floatVar TYPE: FLOATING

 

floatVar = 123456.456789

 

PRINT AsString( floatVar, 2, true )

 

' This prints "123,456.45"