Syntax: |
string = RCHAR(scalar)
|
The RCHAR
function accepts a numeric scalar as first
argument and returns a string. It converts the numeric value to a string using
the default format %g
. You can
specify a C style format string by including it as the optional second string argument.
Examples
function | result |
RCHAR(-1.234) |
'-1.234' |
RCHAR(PI,'pi = %6.4f') |
'pi = 3.1416' |
RCHAR(2*PI,'%10.4E') |
'6.2832E+00' |
RCHAR(2*PI,'%10.4e') |
'6.2832e+00' |
Strings may be appended together using the append operator,
//
. Scalar values can also be
appended to strings using the RCHAR
function. For example,
suppose A = -1.234
, and T
is a
string variable with T = ' units'
.
function | result |
'The value of A is '//RCHAR(A)//T |
'The value of A is -1.234 units' |
'The value of A is '//RCHAR(A,'%4.1f')//T |
'The value of A is -1.2 units' |