Error with "pointing" a string number
I have a number, for example 1234. I want to show it like 1.234 (American people use 1,234)
I was trying with this PHP Code:
|
Re: Error with "pointing" a string number
|
Re: Error with "pointing" a string number
Quote:
|
Re: Error with "pointing" a string number
In the first line you have a "," plus.
|
Re: Error with "pointing" a string number
Quote:
|
Re: Error with "pointing" a string number
If you want to show the number you can do this:
PHP Code:
EDIT: Is tested and it works for me. |
Re: Error with "pointing" a string number
Also tested and confirmed Mxnn. Anyway did my version of it (it should be a little faster):
PHP Code:
|
Re: Error with "pointing" a string number
Yes, Mxnn version works fine. Haven't tried your version quim, dunno which will be faster in my case. I am "converting" 2 numbers which are 99% higher than 1000, and sometimes higher than 1000000, each time a players shoots and hits somebody. Considering that its a 32 slots zombie plague server in which people shoot like crazy, this, may affect (slightly) server perfonmance.
If I can, I'll profile both methods to see the difference. Thanks both of you. |
| All times are GMT -4. The time now is 04:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.