Raised This Month: $344 Target: $400
 86%   Almost there!

...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cristian505
Senior Member
Join Date: Oct 2020
Old 01-28-2022 , 11:37   ...
Reply With Quote #1

...

Last edited by Cristian505; 08-10-2022 at 14:13.
Cristian505 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 01-28-2022 , 11:44   Re: Request info
Reply With Quote #2

Change this szOutput[ iOutputPos++ ] = ',' to anything you want
Ex:
szOutput[ iOutputPos++ ] = ',' = 1,000,000
szOutput[ iOutputPos++ ] = '.' = 1.000.000
szOutput[ iOutputPos++ ] = ' ' = 1 000 000
etc

PHP Code:
// Credits to Bugsy
AddCommasiNum szOutput[ ] , iLen )
{
    new 
szTmp15 ] , iOutputPos iNumPos iNumLen;
    
    if ( 
iNum )
    {
        
szOutputiOutputPos++ ] = '-';
        
iNum absiNum );
    }
    
    
iNumLen num_to_striNum szTmp charsmaxszTmp ) );

    if ( 
iNumLen <= )
    {
        
iOutputPos += copyszOutputiOutputPos ] , iLen szTmp );
    }
    else
    {
        while ( ( 
iNumPos iNumLen ) && ( iOutputPos iLen ) ) 
        {
            
szOutputiOutputPos++ ] = szTmpiNumPos++ ];
        
            if( ( 
iNumLen iNumPos ) && !( ( iNumLen iNumPos ) % ) ) 
            
szOutputiOutputPos++ ] = ',';
        }
        
        
szOutputiOutputPos ] = EOS;
    }
    
    return 
iOutputPos;

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 01-28-2022 at 11:46.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-29-2022 , 11:29   Re: Request info
Reply With Quote #3

PHP Code:
stock Seperate_Digital_Categories(const charSeperator=' ', const szString[], szValue[], len)
{
    new 
iStrLen strlen(szString), index = -1iCounts;

    while( ++
index iStrLen )
    {
        if(!
isdigit(szStringindex ]))
        {
            continue;
        }

        
iCounts++;
    }

    if(!
iCounts)
    {
        return 
false;
    }

    const 
CATEGORY_SIZE 3;

    new 
iSkip = (iCounts CATEGORY_SIZE), iCategory CATEGORY_SIZE iSkip;

    
index = -1;
    
iCounts 0;

    while( ++
index iStrLen )
    {
        if(!
isdigit(szStringindex ]))
        {
            continue;
        }

        if(++
iCounts)
        {
            if(
iCounts len)
            {
                
szValueiCounts-] = szStringindex ];
                break;
            }

            
szValueiCounts-] = szStringindex ];

            if((++
iCategory CATEGORY_SIZE) == 0)
            {
                
iCounts++;
                
szValueiCounts-] = charSeperator;
            }
        }
    }

    return 
true;

Tested works fine !

Output:-

Code:
test_cmd "Hello 500 and 999 + 464567"
OUTPUT: 500 999 464 567
TEST CODE :-
Spoiler
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-29-2022 at 15:15.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:54.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode