Add unit to nutrients summary value

This commit is contained in:
Christopher C. Wells 2021-03-17 05:17:22 -07:00
parent f8b2fdd58c
commit dae2a8d725
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ final class IngredientAmount extends Model
$summary = [];
foreach (Nutrients::all() as $nutrient) {
$amount = round($this->{$nutrient['value']}(), 2);
$summary[] = "{$nutrient['label']}: {$amount}";
$summary[] = "{$nutrient['label']}: {$amount}{$nutrient['unit']}";
}
return implode(', ', $summary);
}