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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rounding of decimals in FP2.5 (DOS)

Status
Not open for further replies.

QT

Programmer
Aug 14, 2000
1
CA
Hi.<br><br>I need to find a way to transfer a numeric (to 12 decimal places) to a table that only allows 6 decimal places, without rounding.&nbsp;&nbsp;The only way I have come up with is to convert to a string, search for the decimal place, then use SUBSTR to return each of the first 6 characters after the decimal.&nbsp;&nbsp;Then I'd convert back to a numeric.&nbsp;&nbsp;But there must be an easier way.&nbsp;&nbsp;Thanks!
 
lndiv = 1000000<br>lntest = 12.123456789012<br>lntest = lntest * lnDiv<br>lntest = int(lntest)<br>lntest = lntest / lnDiv<br>? lnTest<br> <p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top