Take the 2-minute tour ×

Possible Duplicate:
Get the seventh digit from an integer

I have an integer and I want a pair number from it.

var myDigit = 2345346792;

I need the 5th and 6th number out from myDigit namely 34.

What is the mathematical way of getting them without any use of substring?

Additional question from my previous thread: Get the seventh digit from an integer

share|improve this question
add comment

marked as duplicate by Ondrej Tucny, ColinE, Mario, Alan, amit Dec 6 '12 at 23:07


1 Answer

up vote 1 down vote accepted

Repeat your previous solution, using 100 instead of 10 for the modulus and adjusting the division.

share|improve this answer
add comment
