fixes for ammount changer
This commit is contained in:
parent
c3b3419754
commit
2f1347a340
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue