remove precision for currency

This commit is contained in:
Christophe Robillard 2020-07-01 09:28:18 +02:00
parent eaf832c75c
commit cce1435faf
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
module EtablissementHelper
def pretty_currency(capital_social, unit: '€')
number_to_currency(capital_social, locale: :fr, unit: unit)
number_to_currency(capital_social, locale: :fr, unit: unit, precision: 0)
end
def pretty_currency_unit(unit)

View file

@ -49,13 +49,13 @@ RSpec.describe EtablissementHelper, type: :helper do
describe '#pretty_currency' do
subject { pretty_currency(etablissement.entreprise_capital_social) }
it { is_expected.to eq('123 000,00 €') }
it { is_expected.to eq('123 000 €') }
end
describe '#pretty_currency with special unit' do
subject { pretty_currency(12345, unit: 'k€') }
it { is_expected.to eq('12 345,00 k€') }
it { is_expected.to eq('12 345 k€') }
end
describe '#pretty_date_exercice' do
subject { pretty_date_exercice("201908") }