Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
REM >compduration
|
||||
PRINT FN_convert(7259)
|
||||
PRINT FN_convert(86400)
|
||||
PRINT FN_convert(6000000)
|
||||
END
|
||||
:
|
||||
DEF FN_convert(seconds%)
|
||||
LOCAL units%(), units$(), i%, unit%, compound$
|
||||
DIM units%(4)
|
||||
DIM units$(4)
|
||||
units%() = 604800, 86400, 3600, 60, 1
|
||||
units$() = "wk", "d", "hr", "min", "sec"
|
||||
compound$ = ""
|
||||
FOR i% = 0 TO 4
|
||||
IF seconds% >= units%(i%) THEN
|
||||
unit% = seconds% DIV units%(i%)
|
||||
seconds% = seconds% MOD units%(i%)
|
||||
compound$ += STR$(unit%) + " " + units$(i%)
|
||||
IF i% < 4 AND seconds% > 0 THEN compound$ += ", "
|
||||
ENDIF
|
||||
NEXT
|
||||
= compound$
|
||||
Loading…
Add table
Add a link
Reference in a new issue