large numbers, easy comma formula?
I am now dealing with large numbers, for instance, heres part of my vaultdata
Code:
"STEAM_0:1:23359736" "25352" 1275428793is there any way to have this output into a number with commas in it accordingly, like for the last entry PHP Code:
|
Re: large numbers, easy comma formula?
Search around the Scripting Help subforum. There were multiple threads like this in the past couple of months. I believe some people like Emp`, Bugsy, and Exolent have contributed stocks to getting things like these done.
|
Re: large numbers, easy comma formula?
for those that look here looking for the same thing:
http://forums.alliedmods.net/showthr...ghlight=digits |
Re: large numbers, easy comma formula?
Quote:
|
Re: large numbers, easy comma formula?
If your numbers will always be within the signed int32 range ( -2,147,483,648 to 2,147,483,647 ) you can use the below. If the numbers can be outside of this range then this will take a bit more work.
Edit: Discovered -2,147,483,648 is not possible since the positive variant of this is number is 2,147,483,648 which is larger than 2,147,483,647. abs() is used in this function which fails. I have edited the below accordingly. Result Code:
-2147483647 = -2,147,483,647PHP Code:
|
Re: large numbers, easy comma formula?
Again, he wants to manipulate numbers outside the long range, so this comma thing is completely unrelated.
If you really need to manipulate numbers bigger than 2,147,483,648, I can bind some bignum library to Pawn with a small module. |
Re: large numbers, easy comma formula?
Quote:
|
Re: large numbers, easy comma formula?
According to his example code he is just displaying the number as a string with commas.
From Post #3 I assume he has what he wants. |
Re: large numbers, easy comma formula?
Quote:
Quote:
|
Re: large numbers, easy comma formula?
This will work, my main question is answered, but I do have an interest in numbers larger than the int32 base, or whatever it is, I have had 3 or 4 resets due to people saying their points have reset down into the extremely low negatives, for now I have set a cap of 1 billion on the points, but if I can get a nearly infinite base, that would be awesome (why I was presuming calling all numbers a string might help me with this)
case number: "1": { number = "2" } etc. ofcourse, I would also need to format it digit by digit too, which would eventually become quite difficult. does that sum up where im at? |
| All times are GMT -4. The time now is 05:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.