View Single Post
Old 12-05-2012, 12:15 PM   PM User | #5
mh_and
New to the CF scene

 
Join Date: Dec 2012
Posts: 6
Thanks: 4
Thanked 0 Times in 0 Posts
mh_and is an unknown quantity at this point
@007julien can you please explain what exactly this Math.floor(days+11/12) achieves I'm asking this because...

@felgall & Philip M variables days_count and root_days are used elsewhere in the code also, so I thought i can do this (I know i can assign d to anyting after this, but still didn't want to confuse myself)

Code:
if (days%1<0.11) {root_days = Math.floor(days)} else{
	root_days = Math.floor(days)+1;}
	days_count = root_days;
is the modulus good way of replacing parseInt here? It actually works this way, but when I put days%1<0.09 which is logical to me, it just doesn't work well, skips some hours actually.

Oh and I noticed I can use Math.ceil in place of second math.floor.
mh_and is offline   Reply With Quote