From 4a655739347395a694d20dea497c656811df9ec3 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 19 Dec 2020 14:59:16 +0100 Subject: [PATCH] Format numbers on admin donations page And fix the wrong unit display in the user donations list. --- app/views/admin/donations/index.html.erb | 8 ++++---- app/views/donations/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/donations/index.html.erb b/app/views/admin/donations/index.html.erb index 6f4c674..e0d38ce 100644 --- a/app/views/admin/donations/index.html.erb +++ b/app/views/admin/donations/index.html.erb @@ -5,7 +5,7 @@ User - Amount BTC (sats) + Amount BTC in EUR in USD Public name @@ -18,9 +18,9 @@ <% @donations.each do |donation| %> <%= donation.user.cn %> - <%= donation.amount_sats %> - <%= donation.amount_eur %> - <%= donation.amount_usd %> + <%= sats_to_btc donation.amount_sats %> BTC + <%= number_to_currency donation.amount_eur / 100, unit: "" %> + <%= number_to_currency donation.amount_usd / 100, unit: "" %> <%= donation.public_name %> <%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %> <%= link_to 'Show', admin_donation_path(donation) %> diff --git a/app/views/donations/index.html.erb b/app/views/donations/index.html.erb index 0dadba5..7c504de 100644 --- a/app/views/donations/index.html.erb +++ b/app/views/donations/index.html.erb @@ -18,7 +18,7 @@ <%= sats_to_btc donation.amount_sats %> BTC

- (~ <%= number_to_currency donation.amount_eur / 100 %> EUR) + (~ <%= number_to_currency donation.amount_eur / 100, unit: "" %> EUR)

<% if donation.public_name.present? %>