We're dividing 40746227 by 507 
Let's see how many times 507 fits into 40746227.

Let's proceed to step 1:
The number 507 fits into 4 0 times, leaving a remainder of 4.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 4, we end up with 4.
Take the next digit (0) from the dividend and append it to 4, then repeat: 40 / 507

On to step 2:
If we divide 40 by 507, we get 0 and a remainder of 40.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtract 0 from 40 to get 40.
Fetch the next digit (7) from the dividend, attach it to 40 and continue: 407 / 507

Step 3:
507 can be fit into 407 0 times, resulting in a remainder of 407.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Subtracting 0 from 407 leaves us with 407.
Bring next digit (4) of the dividend behind the 407 and repeat the process: 4074 / 507

Step 4:
4074 divided by 507 is 8 with a remainder of 18.
Use 8 as the next digit of our solution. 
Result so far: 8.0
Subtracting 4056 from 4074 leaves us with 18.
Take the next digit (6) from the dividend and append it to 18, then repeat: 186 / 507

Moving on to step 5:
The number 507 fits into 186 0 times, leaving a remainder of 186.
The next digit of our result is 0. 
Result so far: 80.0
If we subtract 0 from 186, we get 186.
Include the next digit (2) from the dividend after 186, then repeat: 1862 / 507

Moving on to step 6:
If we divide 1862 by 507, we get 3 and a remainder of 341.
Write down 3 as next digit of the result. 
Result so far: 803.0
Subtract 1521 from 1862 to get 341.
Include the next digit (2) from the dividend after 341, then repeat: 3412 / 507

Let's proceed to step 7:
507 goes into 3412 6 times with a remainder of 370.
Use 6 as the next digit of our solution. 
Result so far: 8036.0
The remainder is 370 after subtracting 3042 from 3412.
Grab the next digit (7) from the dividend, add it to 370, then carry on: 3707 / 507

Let's proceed to step 8:
If we divide 3707 by 507, we get 7 and a remainder of 158.
The number 7 becomes the next digit in our result. 
Result so far: 80367.0
The remainder is 158 after subtracting 3549 from 3707.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1580, and continue the process.

On to step 9:
The number 507 fits into 1580 3 times, leaving a remainder of 59.
The next digit of our result is 3. 
Result so far: 80367.3
If we take 1521 away from 1580, we end up with 59.
Since there are no more digits in the dividend, we add a zero to the remainder making it 590, and continue the process.

Going ahead to step 10:
590 divided by 507 is 1 with a remainder of 83.
Write down 1 as next digit of the result. 
Result so far: 80367.31
The remainder is 83 after subtracting 507 from 590.
Since there are no more digits in the dividend, we add a zero to the remainder making it 830, and continue the process.

Moving on to step 11:
The number 507 fits into 830 1 times, leaving a remainder of 323.
Write down 1 as next digit of the result. 
Result so far: 80367.311
Subtract 507 from 830 to get 323.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3230, and continue the process.

In conclusion, the division gives 80367.311 with a balance of 0.0323.