home *** CD-ROM | disk | FTP | other *** search
- * ────────────────────────────────────────────
- * format numerics with floating $ sign and
- * rejustifies to the right if requested
- * ────────────────────────────────────────────
- * syntax: Float_Ds(Nvar,Nlen,Rjst)
- * Nvar: numeric value of field
- * Nlen: length of field
- * Rjst: .T. for right just
- *
- * returns: Fvar
-
- Function Float_Ds
- Parameters Nvar,Nlen,Rjst
-
- Private cvar,; && character conversion of number
- clen,; && length of converted field
- fvar && formatted output
-
- * currently set to allow for up to 11 positions (99999999.99)
- cvar = str(nvar,11,2)
-
- * increment by 1 to account for $
- nlen = nlen + 1
-
- * left trim and attach $
- fvar = '$' + ltrim(cvar)
-
- If Rjst
- * pad back out w/blanks to original size of field
- clen = len(fvar)
-
- * get # of positions to pad for right just
- padd = nlen - clen
- fvar = space(padd) + fvar
- Endif
-
- Return(fvar)
-
- * Eofunc - Float_Ds