Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : NAN0304.ZIP
Filename : TRUNC.PRG

 
Output of file : TRUNC.PRG contained in archive : NAN0304.ZIP
* Function: Truncate()
* 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)


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : NAN0304.ZIP
Filename : TRUNC.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/