On page 70 of Hartshrone's Algebraic Geometry he defined a sheaf $O$ of rings on $\operatorname{Spec} A$ for some ring $A$. In particular, $O(U)$ is the set of functions $s: U \rightarrow \coprod_{p \in U} A_{p}$ s.t. $s(p) \in A_p$ and $s$ is locally a quotient of elements of $A$: meaning for each $p \in U$, there is a nbhd $V$ of $p$, contained in $U$, and elements $a,f \in A$, s.t. for each $q \in V$, $f \not\in q$, and $s(q) = a/f$ in $A_q$.
My question is that if $A_q$ is the localisation of $A$ at $q$, then surely if $a/f \in A_q$ we must have $f \in q$, which is the opposite of what is written above. I feel like I am missing something crucial and would appreciate any help.