Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : NN0304.ZIP
Filename : TRUNC.PRG
* Author: A. Timothy Wong
* Version: Clipper Summer '87
* Note(s): Truncates a number at a certain decimal place.
*
* Copyright (C) 1988 Nantucket Corp.
FUNCTION Truncate
PARAMETERS Number, DecPlaces
PRIVATE RetVal, NStr, Temp1, Temp2
NStr = STR(Number)
Temp1 = AT(".",NStr) && Position of decimal point.
Temp2 = LEN(NStr) - Temp1 && Find total decimal places.
DecPlaces = MIN(Temp2,DecPlaces) && if Total decimal places is
** less than needed.
RetVal = VAL(SUBSTR(NStr,1,Temp1 + DecPlaces))
RETURN(RetVal)
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/