More flexible configuration for human_float_number

This commit is contained in:
Alexander Meindl 2018-04-05 08:55:12 +02:00
parent adbb74cb40
commit b6fad2e92d

View File

@ -388,10 +388,10 @@ module Additionals
l(:show_welcome_right) => 'right' }, active)
end
def human_float_number(value, sep = '.')
def human_float_number(value, options = {})
ActionController::Base.helpers.number_with_precision(value,
precision: 2,
separator: sep,
precision: options[:precision].presence || 2,
separator: options[:separator].presence || '.',
strip_insignificant_zeros: true)
end
end