Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Convert a Math result to string

Status
Not open for further replies.

allserve

Programmer
Feb 14, 2002
9
NL
35 / 55 gives results 0.62

Set decimal to 4
Str(34 / 55) gives results 1
How to solve this?
 
HI
Use the following code..

? STR(34/55,myStringLength,myDecimalsRequired)

For example..
? str(34/55,10,4)
Hope this helps :)
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
FOX HELP for STR function:

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.

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 extra digits are truncated.

Hope this helps.
Salmano.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top