I read that the modulo operation finds remainder after division. My misconseption here is about the remainder. Is the remainder the last digit of the result? I thought it was the first.
Example: $5/7 = 0.7142857142857142857...$
$5 \mod 8 = 7$.
$7/3 = 2.33333..$ but $7 \mod 3 = 1$. Remainder of the first result is point 3333...
$9/4 = 2.25$ $9 \mod 4 = 1$. Ok same as first but different remainder.
$9/7 = 1.2857142857142...$ $9 \mod 7 = 2$. What? Remainder is two, the first digit. This is probably "random" for reals? But not for integers?
$111111111$ : If there are nine ones we should divide by $7$, it gives $2$ remnants. Since $9-2=7$ ones. So using modulo operation on the reals is not something one should do?
When you want to compute $a \bmod b$ with $a,b$ positive integers, you do division like you learned in school and write $a=qb+r$ where $q$ is the quotient and $r$ is the remainder. We typically choose $r$ to be in the range $0$ to $b-1$. Then we write $r=a \bmod b$, so is you want $1234 \bmod 7$, you write $1234=176\cdot 7 + 2$, so $1234 \bmod 7=2$. You don't need to do anything with the decimal expansion.
The main time I have seen the modulo operation used with the modulus $b$ other than an integer is reducing angles of a circle when the angles are measured in radians. You compute an angle, then take it $\mod 2\pi$ to put the angle in the range $[0,2\pi)$. You can use other moduli, but this is the common one.