PDA

View Full Version : Error in vb_number_format function?


Linhnt
04-20-2011, 04:49 AM
I have writen my own modification in vbulletin 4.1.3 and It's have an error


My Language setting:
Decimal Separator: .
Thousands Separator: ,

Example error:

My number:
$mynumber = 50000;

if I use vb_number_format() in plugin:
$formated = vb_number_format($mynumber);
The result is corect: 50.000

But if I use number format in template:
{vb:number {vb:raw mynumber}}
The result is incorect: 50,000

What is the problem? Is It a bug of vbulletin??

Sorry, I can't post new issua in tracker.vbulletin.com

prevb
04-25-2011, 04:40 AM
Same problem

Boofo
04-25-2011, 05:17 AM
This:

$formated = vb_number_format($mynumber);


Should be this if you are using the mynumber in the template.

$mynumber = vb_number_format($mynumber);


And make sure you pre-register the mynumber variable for the template you want to use it in.