Str2$(Function)
Converts to a numeric character string with the numeric value format specified.
Str2$ (<Expression>,<Integer Part>,<Fractional Part>,<0 Suppression>,<Negative Expression>)
Parameters
<Expression>
|
The expression to be converted (integer type or double-precision type).
|
<Integer Part>
|
The number of digits for the integer part (integer).
|
<Fractional Part>
|
The number of digits for the fractional part (integer).
|
<0 Suppression>
|
The fill method for the region of empty spaces to the left (integer).
|
<Negative Expression>
|
The method of expressing negatives (integer).
|
Return Value
Returns the value of the character string.
The content of the value is the converted character string.
Description
The numeric value specified by the <Expression> is converted into a character string. A numeric value cannot be directly assigned to a character variable. It is assigned to a character variable after it has been converted to a number in character notation in accordance with the specified format using the Str2$ function.
Specify the number of integer digits in <Integer Part>.0 - 8 can be specified. When 0 is specified, it is taken to mean "all of the digits present".
Example: In the case where 0 is specified for the Integer Part.
If the <Expression> is 99, then it becomes 99
If the <Expression> is 999, then it becomes 999
Specify the number of fraction digits in the <Fractional Part>.0 - 5 can be specified.If 0 is specified, everything after the radix point will be rounded up.
Example: In the case where 0 is specified for the Fractional Part.
If the <Expression> is 99.099, then it becomes 99
If the <Expression> is 999.999, then it becomes 1000
For numeric values that cannot be contained within the digits specified for the <Integer Part> the specified digits will be the maximum value.(In the case of negative values, it becomes the minimum value)
Example:
In the case where 2 is specified for the Integer Part and 0 is specified for the Fractional Part.
If the <Expression> is 179.099 then it becomes 99
Rounding is carried out for numeric values that cannot be accomodated within the digits specified for <Integer Part>/<Fractional Part>.
Example: In the case where the integer 8 is specified for the Integer Part and 0 for the Fractional Part:
If the <Expression> is 99.999, then it becomes 100
Specify the following values for <0 Suppression>.
0: Fill with spaces
1: Fill with zeros
Specify the following values for the <Negative Expression>.
0: -
1: 8
(The <Negative Expression> is included in the number of digits of the Integer Part.It follows that even in numeric values with the same absolute values, the number of digits in the negative number becomes larger.
Example: In the case where the integer 3 is specified for the Integer Part and 3 for the Fractional Part:
If the <Expression> is 999.999, then it becomes 999.999
If the <Expression> is -999.999, then it becomes -99.999
Example
Convert a measurement value to a character string and output it to the macro console.
RESX$=Str2$(150,3,3,0,0)
RESY$=Str2$(359,3,3,0,0)
RESCR$=Str2$(97,3,0,0,0)
Print RESX$+","+RESY$+","+RESCR$
The results are as follows:In the case where (X,Y)=(150,359) and the Correlation Value is 97.
150.000,359.000, 97