fixes for ammount changer

This commit is contained in:
Adrian Hinz 2022-05-05 14:54:34 +02:00
parent c3b3419754
commit 2f1347a340
2 changed files with 10 additions and 10 deletions

View File

@ -3,21 +3,21 @@
# helper for home
module HomeHelper
def change_ammount(ammount)
return '' if ammount.blank?
ret = if ammount >= 1_000_000
"#{ammount / 1_000_000} mln"
else
"#{ammount / 1_000} tys."
end
ret
HomeHelper.change_ammount(ammount)
end
def self.change_ammount(ammount)
return '' if ammount.blank?
ret = if ammount >= 1_000_000
"#{ammount / 1_000_000} mln"
amm = ammount / 1_000_000
rest = (ammount % 1_000_000) / 1_000
re1 = if rest.zero?
amm
else
"#{amm}.#{rest}".to_f.to_s.tr('.', ',')
end
"#{re1} mln"
else
"#{ammount / 1_000} tys."
end

View File

@ -132,7 +132,7 @@
</div>
<div class="row">
<div class="col-md-12">
<%= render '/partners/partner_show', partner: @dotation.partner %>
<%= render '/partners/partner_show', partner: @dotation.partner, div_id: 'test' %>
</div>
</div>
<div class="row">