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 cool, mod;
cool = random_num(1, 10000); // Ex: 116
mod = cool % 10; // 6
cool = (cool - mod) / 10; // 116 - 6 = 110 / 10 = 11
Exist another (
better) way ?
Thanks in advanced!