Navigation:  MCL Reference > Conversion Functions >

Str( )

Print this Topic Previous pageReturn to chapter overviewNext page

The Str( ) function is a Visual FoxPro function which returns the character equivalent of a specified numeric expression.

 

Syntax

STR(nExpression,nLength,nDecimalPlaces)

 

nExpression

Specifies the numeric expression STR( ) evaluates.

nLength

Specifies the length of the character string STR( ) returns. The length includes one character for the decimal point and one character for each digit to the right of the decimal point.

STR( ) pads the character string it returns with leading spaces if you specify a length larger than the number of digits to the left of the decimal point. STR( ) returns a string of asterisks, indicating numeric overflow, if you specify a length less than the number of digits to the left of the decimal point. If nLength isn't included, the length of the character string defaults to 10 characters.

nDecimalPlaces

Specifies the number of decimal places in the character string STR( ) returns. You must include nLength to specify the number of decimal places. If you specify fewer decimal places than are in nExpression, the return value is rounded. If nDecimalPlaces isn't included, the number of decimal places defaults to zero.

 

Returns

Character

 

 


Page url: http://www.racematenet.com/english/help/index.html?str.htm