import csv


def nums_to_grams(product_ids: list, num_product: str):
    """
    Return the quantity of product in grams (translates nums in grams).
    """
    with open("food_portion.csv") as food_portion:
        food_portion_csv = csv.reader(food_portion, delimiter=',')
        for row in food_portion_csv:
            for product_id in product_ids:
                if product_id in row[0]:
                    return (float(num_product)*float(row[2]), product_id)
    return (None, None)