tirenweb
tirenweb

Reputation: 31729

symfony: format_currency() adds an space before the number

when i do this:

var_dump(format_currency('1004.569'));       

I get:

string ' 1.004,56' (length=10)

Notice that there is a space before the 1.

Any idea?

sf 1.4.

Javi

Upvotes: 0

Views: 631

Answers (1)

xzyfer
xzyfer

Reputation: 14135

The space is where currency symbol belongs. This is because you haven't set the users default culture. If you pass "usd" as the second parameter you should get $1.004,56.

format_currency('1004.569', "usd")

Upvotes: 1

Related Questions