diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5729b08..0391c75 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,7 @@ env: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: "build" steps: - uses: actions/checkout@v3 diff --git a/napoli-pain/src/components/order_details.rs b/napoli-pain/src/components/order_details.rs index bb75ee5..9b0de85 100644 --- a/napoli-pain/src/components/order_details.rs +++ b/napoli-pain/src/components/order_details.rs @@ -173,6 +173,25 @@ impl Component for OrderDetails { }) .collect::>(); + + let total_millicents: i64 = + order + .entries + .iter() + .map(|order| order.price_in_millicents) + .sum(); + + let total_str = match napoli_lib::Millicents::from_raw(total_millicents) { + Ok(price) => { + let (euros, cents) = price.to_euro_tuple(); + format!("{}.{:02}\u{00a0}€", euros, cents) + } + Err(e) => format!( + "Invalid price value: {}; Error: {:?}", + total_millicents, e + ), + }; + let id = order.id; let menu_url = order.menu_url.clone(); let menu_url_text = menu_url.clone(); @@ -189,6 +208,7 @@ impl Component for OrderDetails { +

{"Total: "}{total_str}

} } else {