The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
If there's only one number after the decimal place in a value - add a 0 after it.
How would I go about pulling something like this off?
|
#2
|
|||
|
|||
try the round function.
PHP Code:
g-force2k2 |
#3
|
||||
|
||||
The number is already rounded to two decimal places before being store in the database. I'll try using round again before it is displayed, I don't think it'd work though.
EDIT: No dice. |
#4
|
|||
|
|||
It could perhaps be the column field type that's causing the problem.
Cheers, g-force2k2 |
#5
|
||||
|
||||
Quote:
The column type is varchar. |
#6
|
|||
|
|||
There could perhaps be an easier way then I know of, but instead I just made a quick fucntion:
PHP Code:
PHP Code:
g-force2k2 |
#7
|
||||
|
||||
Works like a charm! Thanks, g-force!
|
#8
|
|||
|
|||
Quote:
Cheers, g-force2k2 |
#9
|
||||
|
||||
i know you've got the way you want it already, but i may say, there is already a function in php which does that afaik
PHP Code:
|
#10
|
||||
|
||||
That shows how much I use number_format
Thank you, Xenon and g-force2k2 for the help. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|