Let's divide 399228 by 40
We're looking to find how many times 40 goes into 399228.

Step 1:
3 divided by 40 is 0 with a remainder of 3.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Deduct 0 from 3 and we're left with 3.
Bring next digit (9) of the dividend behind the 3 and repeat the process: 39 / 40

Going ahead to step 2:
The number 40 fits into 39 0 times, leaving a remainder of 39.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 39 after subtracting 0 from 39.
Grab the next digit (9) from the dividend, add it to 39, then carry on: 399 / 40

Going ahead to step 3:
When dividing 399 by 40, we get 9 with a remainder of 39.
Put 9 as the next digit of the answer. 
Result so far: 9.0
If we subtract 360 from 399, we get 39.
Grab the next digit (2) from the dividend, add it to 39, then carry on: 392 / 40

Step 4:
The number 40 fits into 392 9 times, leaving a remainder of 32.
The next digit of our result is 9. 
Result so far: 99.0
Deduct 360 from 392 and we're left with 32.
Take the next digit (2) from the dividend and append it to 32, then repeat: 322 / 40

Step 5:
40 can be fit into 322 8 times, resulting in a remainder of 2.
The next digit of our result is 8. 
Result so far: 998.0
If we subtract 320 from 322, we get 2.
Take the next digit (8) from the dividend and append it to 2, then repeat: 28 / 40

On to step 6:
When dividing 28 by 40, we get 0 with a remainder of 28.
The next digit of our result is 0. 
Result so far: 9980.0
The remainder is 28 after subtracting 0 from 28.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

Going ahead to step 7:
If we divide 280 by 40, we get 7 and a remainder of 0.
Write down 7 as next digit of the result. 
Result so far: 9980.7
Subtract 280 from 280 to get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Let's proceed to step 8:
40 can be fit into 0 0 times, resulting in a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 9980.7
If we take 0 away from 0, we end up with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Advancing to step 9:
40 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 9980.7
If we take 0 away from 0, we end up with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

The final result is 9980.7 with a remainder of 0.0.