def avg_gb_farmer(collection):
    """Returns the average storage capacity of a farmer in gigabytes.""" 
    avg_gb_farmer = 0
    for doc in collection.find({}).sort([('time', -1)]).limit(1):
        avg_gb_farmer = doc['total_TB'] / doc['total_farmers'] * 1000
    avg_gb_farmer = format(avg_gb_farmer, '.2f')
    return avg_gb_farmer