add a new format to locales

hello list,

i try to add a new format to my locales file de.yml
i looks like that:

        unit: 'm²'
        format: "%n %u"
        precision: 2
        separator: ','
        delimiter: '.'

after that i've copied the number_to_currency method to the
application_controller.rb to get maximum comfort :slight_smile:
but i get the default view of numbers, so it doesnt find my new yml

  def number_to_square_meter(number, options = {})

    defaults = I18n.translate('number.format''number.format', :locale
=> options[:locale], :raise => true) rescue {}
    currency =
I18n.translate('number.square_meter.format''number.square_meter.format', :locale
=> options[:locale], :raise => true) rescue {}
    defaults = defaults.merge(currency)

    precision = options[:precision] || defaults[:precision]
    unit = options[:unit] || defaults[:unit]
    separator = options[:separator] || defaults[:separator]
    delimiter = options[:delimiter] || defaults[:delimiter]
    format = options[:format] || defaults[:format]
    separator = '' if precision == 0

     format.gsub(/%n/, number_with_precision(number,
       :precision => precision,
       :delimiter => delimiter,
       :separator => separator)
     ).gsub(/%u/, unit)

do you have any idea how can i solve that?


best regards