Doily to hat

I put down my knitted top, and I started making a doily pattern to use as a rug. Unfortunately, I used the wrong size needle, and now what I wanted to make into a rug, is not nearly big enough, so I thought I might try to turn this into a hat- but I do not know how. I think I will knit for a few rows after it is finished, but I don’t know how many (if any) I will need to cast off to make the correct shape to make it into a hat. I was thinking maybe I could just knit it to be the right length, then do some rib stitch. What do you think? Do you know of any hat patterns that are top down that I could use a guide?

So what you have now is the top or crown of the hat? Is it the size of a beret at this point?
You could look at some patterns on Ravelry to get an idea of how to long to knit and how to decrease taking your yarn weight and stitch number into account. You may have to reverse the shaping if these are knit ribbing up to top.