It is not usually a good idea to tie a knot in the middle of a row of miniature knitting, or even work a few stitches with both old and new yarns, as this will always show. So if you are unsure whether you will have enough yarn to complete the row or even cast off at the end of a piece of knitting, you may like to try this simple method of calculation.
A quick way to calculate whether you will have enough yarn to complete a row, is to spread out the stitches and see if the yarn is at least THREE times as long as the width of the row you are working.
Remember if you are right at the end of a ball of yarn, you also need to allow enough yarn for actually working the stitches, working a stitch with a really tiny length of yarn could prove impossible. So see how much yarn you would require to take around the needle (and hold comfortably) whilst you work the stitch and add this amount to your calculation.
Note: Although this works for any size knitting, it may be harder to measure the width on a full size item. If you have a lot of stitches on shorter needles or are using a circular needle which compresses the stitches, you may need to measure across the width of the work with a tape measure, multiply this number by three, then measure the amount of yarn you have left to work with.