sr10952 / MyStudyTracker

0 stars 0 forks source link

Calculations are off #13

Open sr10952 opened 4 months ago

sr10952 commented 4 months ago

The calculations need to be reviewed and redefined. Total hours seems off

sr10952 commented 4 months ago

I think we will remobe rounding


def hours_to_hhmm(hours):
    total_minutes = int(hours * 60)  # Using int to truncate decimals
    # Calculate hours and minutes
    hh = total_minutes // 60
    mm = total_minutes % 60
    # Return formatted string
    return f"{hh:02d}:{mm:02d}"