AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Calculating problem (https://forums.alliedmods.net/showthread.php?t=89179)

BalkY 04-03-2009 10:08

Calculating problem
 
Hello guys, I have a little problem with calculate/convert one value.
So I have:

new bubu = 126856
client_print(id, print_chat, "%02d:%02d.%03d", (How I must calculate/convert here))

and it should return: 01:26:856

SchlumPF* 04-03-2009 10:26

Re: Calculating problem
 
PHP Code:

    new integer 126856;
    
    new 
Float:decimal float( integer ) / 1000.0// convert it to seconds for the following calculations
    
    
new minutes floatrounddecimal 60floatround_floor );
    new 
seconds floatrounddecimal 60 minutesfloatround_floor );
    new 
milisec floatround( ( decimal - ( minutes 60 seconds ) ) * 1000.0floatround_floor );
    
    
//log_amx( "%i %02i:%02i:%03i", integer, minutes, seconds, milisec ); 


BalkY 04-03-2009 10:35

Re: Calculating problem
 
Thank you very much! :)


All times are GMT -4. The time now is 02:17.

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