Raised This Month: $32 Target: $400
 8% 

Scripting Forum


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mehelp
Junior Member
Join Date: Jul 2011
Old 07-23-2011 , 23:22   Re: Scripting Forum
Reply With Quote #33

berni shared tis
PHP Code:
stock FormatNumberInt(valueString:buffer[], sizeseperator=',')
{
    
decl String:helper[size];
    
IntToString(valuehelpersize);
    
strcopy(buffersizehelper);

    new 
length strlen(helper);

    new 
n_helper;

    if (
helper[0] == '-') {
        
n_helper += ((length-1) % 3) + 1;

        if (
n_helper == 1) {
            
n_helper 4;
        }
    }
    else {
        
n_helper += length 3;

        if (
n_helper == 0) {
            
n_helper 3;
        }
    }

    new 
n_buffer n_helper;

    while (
n_helper length) {
        
buffer[n_buffer] = seperator;
        
strcopy(buffer[n_buffer 1], sizehelper[n_helper]);

        
n_buffer += 4;
        
n_helper += 3;
    }

mehelp is offline
 



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 12:39.


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