Converts a numeric expression and it assigns the result to a text variable.
Optional [addCommas] parameter when set to True will add commas to the integer portion of a large number.
Usually this is wanted when the results are to be used in a report where the number of decimal value must be controlled. It will also provide comma separation for large numbers.
Syntax: |
---|
stringVariable = AsString( expression, [ decimals ], [addCommas] ) |
Parameter: |
Description: |
---|---|
expression |
Expression to convert |
[ decimals ] |
Optional number of decimals to display |
[addCommas] |
Optional True/False to include commas in the number |
stringVariable |
Expression converted to a character string. |
Example: |
---|
' ----------------------------------------------- VARIABLES: integerOne, integerTwo TYPE: INTEGER PRINT AsString(integerOne) + AsString(integerTwo)
Result:This prints "579" This prints "123456"
|
' -----------------------------------------------
Result:No Commas in number: 1235687.14 Account Balance is 1,235,687.14
|
' ----------------------------------------------- VARIABLES: floatVar TYPE: FLOATING floatVar = 123.456789
PRINT AsString( floatVar, 2 ) Result:This prints "123.45"
Result:This prints "123,456.45" |
Links: |
---|
AsFloating, AsInteger, AsSeries, IsFloating, IsInteger, IsString, FormatString |
See Also: |
|
Edit Time: 9/18/2020 11:54:13 AM |
Topic ID#: 47 |