We look at the division of 158167 by 504 
Our goal is to divide 158167 by 504.

Step 1:
The number 504 fits into 1 0 times, leaving a remainder of 1.
The next digit of our result is 0. 
Result so far: 0.0
If we subtract 0 from 1, we get 1.
Append the next digit (5) from the dividend to 1 and continue with: 15 / 504

Advancing to step 2:
504 can be fit into 15 0 times, resulting in a remainder of 15.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 15, we end up with 15.
Append the next digit (8) from the dividend to 15 and continue with: 158 / 504

Going ahead to step 3:
When dividing 158 by 504, we get 0 with a remainder of 158.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Deduct 0 from 158 and we're left with 158.
Grab the next digit (1) from the dividend, add it to 158, then carry on: 1581 / 504

On to step 4:
504 can be fit into 1581 3 times, resulting in a remainder of 69.
Record the quotient 3 as the next digit in the result. 
Result so far: 3.0
If we subtract 1512 from 1581, we get 69.
Fetch the next digit (6) from the dividend, attach it to 69 and continue: 696 / 504

Moving on to step 5:
504 can be fit into 696 1 times, resulting in a remainder of 192.
The next digit of our result is 1. 
Result so far: 31.0
If we subtract 504 from 696, we get 192.
Include the next digit (7) from the dividend after 192, then repeat: 1927 / 504

Going ahead to step 6:
When dividing 1927 by 504, we get 3 with a remainder of 415.
Use 3 as the next digit of our solution. 
Result so far: 313.0
Subtract 1512 from 1927 to get 415.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4150, and continue the process.

Going ahead to step 7:
If we divide 4150 by 504, we get 8 and a remainder of 118.
Write down 8 as next digit of the result. 
Result so far: 313.8
Deduct 4032 from 4150 and we're left with 118.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1180, and continue the process.

Let's proceed to step 8:
504 can be fit into 1180 2 times, resulting in a remainder of 172.
Record the quotient 2 as the next digit in the result. 
Result so far: 313.82
If we take 1008 away from 1180, we end up with 172.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1720, and continue the process.

On to step 9:
1720 divided by 504 is 3 with a remainder of 208.
Record the quotient 3 as the next digit in the result. 
Result so far: 313.823
Subtract 1512 from 1720 to get 208.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2080, and continue the process.

On to step 10:
504 goes into 2080 4 times with a remainder of 64.
Put 4 as the next digit of the answer. 
Result so far: 313.8234
Deduct 2016 from 2080 and we're left with 64.
Since there are no more digits in the dividend, we add a zero to the remainder making it 640, and continue the process.

Going ahead to step 11:
When dividing 640 by 504, we get 1 with a remainder of 136.
Use 1 as the next digit of our solution. 
Result so far: 313.82341
If we subtract 504 from 640, we get 136.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1360, and continue the process.

Let's proceed to step 12:
If we divide 1360 by 504, we get 2 and a remainder of 352.
Use 2 as the next digit of our solution. 
Result so far: 313.823412
Subtracting 1008 from 1360 leaves us with 352.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3520, and continue the process.

On to step 13:
If we divide 3520 by 504, we get 6 and a remainder of 496.
Record the quotient 6 as the next digit in the result. 
Result so far: 313.8234126
Subtracting 3024 from 3520 leaves us with 496.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4960, and continue the process.

Advancing to step 14:
If we divide 4960 by 504, we get 9 and a remainder of 424.
The next digit of our result is 9. 
Result so far: 313.82341269
If we subtract 4536 from 4960, we get 424.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4240, and continue the process.

The quotient of the division is 313.82341269, and the remainder is 4.24e-07.