Search - User list
Full Version: how to i extract int digits?
Root » Houdini Indie and Apprentice » how to i extract int digits?
ordiza
for example
23->3
31->1
102->2
123->23



sorry i cant write english well.
carstenw
Hi,

in HScript, you will need the % operator (modulo):

/ -> echo `1984 % 10`
4
/ -> echo `1984 % 100`
84
/ -> echo `1984 % 1000`
984

Using 10, 100, 1000 as the 2nd argument gives you 1, 2, or 3 digits from the end of the number.

Regards,
Carsten
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB