Is it possible to use "number_to_currency" inside a controller?
Yes, you could do with:
view_context.number_to_currency(d.price)
or
ActionController::Base.helpers.number_to_currency(d.price)
Try:
include ActionView::Helpers::NumberHelper