in reply to Converting to decimal elsif

It's not clear what you're trying to produce here, but if you're trying to detect ranges, you could do this:

if ($start_minute < 7.5) {$start_minute = .0 ;} elsif ($start_minute < 22.5) {$start_minute = .25 ;} elsif ($start_minute < 37.5) {$start_minute = .5 ;} elsif ($start_minute < 52.5) {$start_minute = .75 ;} else {$start_minute = 1.0}

Replies are listed 'Best First'.
Re: Re: Converting to decimal elsif
by nlafferty (Scribe) on Jul 26, 2001 at 01:16 UTC
    I'm actually tring to round my values from a time value to the nearest 15 minutes. Then convert it to a decimal. Thanks, I'll give your example a shot