number_to_currency not working since 2.1.1

Back in 2.1.1 everything was sweet:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)
"$12.30"

Then I upgraded to 2.3.2 and:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)
12.3

Woops! Lets try to be more explicit

number_to_currency(12.3, :unit => "€")
12.3

Well that didnt work either, lets try upgrading to the latest version
of Rails

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)
12.3

Pretty weird stuff - one of my coworkers has the same problem on his
setup.

Can anyone reproduce this bug?

Back in 2.1.1 everything was sweet:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

“$12.30”

Then I upgraded to 2.3.2 and:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

12.3

Woops! Lets try to be more explicit

number_to_currency(12.3, :unit => “€”)

12.3

Well that didnt work either, lets try upgrading to the latest version

of Rails

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

12.3

Pretty weird stuff - one of my coworkers has the same problem on his

setup.

Can anyone reproduce this bug?

I tried the above and here’s my transcript:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

=> “$12.30”

What platform are you using to execute the above?

-Conrad

Are you sure you don’t use any old localization plugin or piece of code that overwrites the default?

Best regards

Peter De Berdt

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper
=> Object

number_to_currency(12.3)
12.3

Pretty weird stuff - one of my coworkers has the same problem on his

setup.

Can anyone reproduce this bug?

I tried the above and here’s my transcript:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

=> “$12.30”

What platform are you using to execute the above?

Are you sure you don’t use any old localization plugin or piece of code that overwrites the default?

Best regards

Peter De Berdt

I’m sure because this project doesn’t use any plugins. You might want to check project configuration.

-Conrad

Hehehe Conrad, I was actually addressing the plugin question to the original poster :slight_smile:

Best regards

Peter De Berdt

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper
=> Object

number_to_currency(12.3)
12.3

Pretty weird stuff - one of my coworkers has the same problem on his

setup.

Can anyone reproduce this bug?

I tried the above and here’s my transcript:

Loading development environment (Rails 2.3.3)

include ActionView::Helpers::NumberHelper

=> Object

number_to_currency(12.3)

=> “$12.30”

What platform are you using to execute the above?

Are you sure you don’t use any old localization plugin or piece of code that overwrites the default?

Best regards

Peter De Berdt

I’m sure because this project doesn’t use any plugins. You might want to check project configuration.

Hehehe Conrad, I was actually addressing the plugin question to the original poster :slight_smile:

Best regards

Peter De Berdt

Peter, sorry about that.

-Conrad

I'm using Rails I18n, which seems to be the problem

I cant figure out why its not working though, my en.yml faile looks
legit:

  number:
    format:
      precision: 2
      separator: ','
      delimiter: '.'
    currency:
      format:
        unit: '€'
        format: '%n%u'
        separator:
        delimiter:
        precision:
    percentage:
      format:
        delimiter: ""
    precision:
      format:
        delimiter: ""
    human:
      format:
        delimiter: ""
        precision: 1
      storage_units:
        # Storage units output formatting.
        # %u is the storage unit, %n is the number (default: 2 MB)
        format: "%n %u"
        units:
          byte:
            one: "Byte"
            other: "Bytes"
          kb: "KB"
          mb: "MB"
          gb: "GB"
          tb: "TB"

So it turns out the the technical problem is that I am a numbnuts :confused:

There was another number: specificied in the yaml file that was
overriding the defaults

DUH! *smacks self in forehead*