AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with quotient [SOLVED] (https://forums.alliedmods.net/showthread.php?t=204089)

Kiske 12-27-2012 16:43

Problem with quotient [SOLVED]
 
Hi everyone,

I want to get all number except last digit.
Example:
Code:

16 = 1
19 = 1
26 = 2
31 = 3
49 = 4
71 = 7
189 = 18
12944 = 1294

This is my method:
PHP Code:

new coolmod;

cool random_num(110000); // Ex: 116
mod cool 10// 6

cool = (cool mod) / 10// 116 - 6 = 110 / 10 = 11 

Exist another (better) way ?


Thanks in advanced!

Kiske 12-27-2012 17:06

Re: Problem with quotient
 
LOL
PHP Code:

new mod cool 10

Thanks gladius..

Solved.


All times are GMT -4. The time now is 13:45.

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