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">
|
<ul class="list-group mb-2">
|
||||||
{for r.ingredients.iter().map(|(id, info, amount)| {
|
{for r.ingredients.iter().map(|(id, info, amount)| {
|
||||||
let delete_modal_id = format!("rcpRmIg{id}");
|
let delete_modal_id = format!("rcpRmIg{id}");
|
||||||
|
let amount_rounded = amount.round();
|
||||||
html!{
|
html!{
|
||||||
<li
|
<li
|
||||||
key={*id}
|
key={*id}
|
||||||
class="list-group-item d-flex justify-content-between align-items-center"
|
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>
|
<div>
|
||||||
<ConfirmDangerModal
|
<ConfirmDangerModal
|
||||||
id={delete_modal_id.clone()}
|
id={delete_modal_id.clone()}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue