app: Round ingredients to whole numbers
This commit is contained in:
parent
47e4eed1a9
commit
96a9907f7a
1 changed files with 2 additions and 1 deletions
|
|
@ -824,12 +824,13 @@ fn RecipeViewerInner(props: &RecipeViewerInnerProps) -> HtmlResult {
|
|||
<ul class="list-group mb-2">
|
||||
{for r.ingredients.iter().map(|(id, info, amount)| {
|
||||
let delete_modal_id = format!("rcpRmIg{id}");
|
||||
let amount_rounded = amount.round();
|
||||
html!{
|
||||
<li
|
||||
key={*id}
|
||||
class="list-group-item d-flex justify-content-between align-items-center"
|
||||
>
|
||||
{format!("{amount}{} {}", info.unit.as_deref().unwrap_or(""), info.name)}
|
||||
{format!("{amount_rounded}{} {}", info.unit.as_deref().unwrap_or(""), info.name)}
|
||||
<div>
|
||||
<ConfirmDangerModal
|
||||
id={delete_modal_id.clone()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue