There is no exact number before 8 inches since the numbers are continuous, but I think you are asking what is the exact value of the *marking* just before 8 inches.
Obviously that depends on the markings on your ruler.
Some rulers might only be marked to the nearest 1/4 inch. So the mark before would be 7 3/4.
Others might be marked to the nearest 1/8 inch. So the mark before would be 7 7/8.
If it's the nearest 1/16 inch, then the value before is 7 15/16.
And if it's to the nearest 1/32 inch, then the value before is 7 31/32.
For all practical purposes, that's usually the smallest unit (though you can see it could continue on to 7 63/64, 7 127/128, etc.)
Basically take 8 inches and subtract one unit of marking on the ruler. For example, on a ruler with 1/32 markings:
8 - 1/32
= 7 31/32