home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
CLIPPER
/
NCCLIB.ZIP
/
NCCCODE.ZIP
/
YEARMTHS.PRG
< prev
Wrap
Text File
|
1992-11-04
|
925b
|
25 lines
//═══════════════════════════════════════════════════════╕
// Program .....: Yearmths │
// CopyRight ...: 1992 National Computer Consultants │
// All rights are reserved. │
// Author ......: Greg Rice │
//═══════════════════════════════════════════════════════╛
//───────────────────────────────────────┐
// Function...: years_mths() │
// Syntax.....: years_mths(<exp>) │
// ---- <exp> = Number of months │
//───────────────────────────────────────┘
Function years_mths(x_num)
local no_years, dot, x_years, x_months
no_years := ltrim(str(x_num / 12,10,2))
dot := AT(".", no_years)
x_years := substr(no_years, 1, dot - 1)
x_months := ltrim(str((val(substr(no_years, dot + 1)) * 12) / 100, 1))
Return( x_years + " years and " + x_months + " months." )