Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fcn toWDHMS(sec){ //-->(wk,d,h,m,s)
|
||||
r,b:=List(),0;
|
||||
foreach u in (T(60,60,24,7)){
|
||||
sec,b=sec.divr(u); // aka divmod
|
||||
r.append(b);
|
||||
}
|
||||
r.append(sec).reverse()
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
fcn toWDHMS(sec){ //-->(wk,d,h,m,s)
|
||||
T(60,60,24,7).reduce(fcn(n,u,r){ n,u=n.divr(u); r.append(u); n },
|
||||
sec,r:=List()):r.append(_).reverse();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
units:=T(" wk"," d"," hr"," min"," sec");
|
||||
foreach s in (T(7259,86400,6000000)){
|
||||
toWDHMS(s).zip(units).pump(List,fcn([(t,u)]){ t and String(t,u) or "" })
|
||||
.filter().concat(", ").println();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue