You can monkey patch this method in the initializers. Create one, or append the following to a initializer in config/initializers
.
require 'action_view'
module ActionView::Helpers::NumberHelper
alias_method :__number_with_precision, :number_with_precision
private :__number_with_precision
def number_with_precision(number, options = {})
options = {precision: 2}.merge(options)
__number_with_precision(number, options)
end
end
Alternate Approach
It may not be a good idea to override the internal methods like this as it may lead to unexpected results in codebase being worked by several developers. A better approach is to override the defaults via config/locales/en.yml
as explained in this answer.