Finding the right size of nut for a bolt
Judging by the pitch and diameter you've measured, what you probably have is an American UNC 6-32 screw.
There are many conversion charts on the interwebs, but if you refer to this one in particular you can see the diameter for a #6 thread is 0.138" or 3.5mm.
The 2nd number in the UNC scheme is the number of threads per inch, so taking 25.4mm per inch and dividing by 32 gives you 0.79375mm - suspiciously close to your measured 0.8mm.