开发者

symfony: format_currency() adds an space before the number

开发者 https://www.devze.com 2023-02-08 02:32 出处:网络
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.

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.

Ja开发者_如何转开发vi


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")
0

精彩评论

暂无评论...
验证码 换一张
取 消