# Number\_to\_currency not working since 2.1.1

**URL:** <https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641>\
**Category:** Rails\
**Created:** [July 24, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641 "2009-07-24T12:27:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/1 "2009-07-24T12:27:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 1:33pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/2 "2009-07-24T13:33:18Z")

</div>

On 24 Jul 2009, at 12:41, Conrad T. wrote:

> 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

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 12:42pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/3 "2009-07-24T12:42:24Z")

</div>

On Fri, Jul 24, 2009 at 3:26 AM, pimpmaster [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 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

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 1:36pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/4 "2009-07-24T13:36:49Z")

</div>

On Fri, Jul 24, 2009 at 4:32 AM, Peter De Berdt  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > setup.  
> > =\> “$12.30”
> 
> Peter De Berdt

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

-Conrad

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 1:42pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/5 "2009-07-24T13:42:40Z")

</div>

On 24 Jul 2009, at 13:36, Conrad T. wrote:

> > 
> 
> 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 🙂

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/6 "2009-07-24T15:04:02Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 1:44pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/7 "2009-07-24T13:44:25Z")

</div>

On Fri, Jul 24, 2009 at 4:41 AM, Peter De Berdt  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > > setup.  
> > > =\> “$12.30”  
> > > Peter De Berdt  
> > > Best regards
> 
> Peter De Berdt

Peter, sorry about that.

-Conrad

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [July 24, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/number-to-currency-not-working-since-2-1-1/172641/8 "2009-07-24T16:11:21Z")

</div>

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

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

DUH! _smacks self in forehead_
