  We introduce the concept of Stanley decompositions in the localized
polynomial ring $S_f$ where $f$ is a product of variables, and we show that the
Stanley depth does not decrease upon localization. Furthermore it is shown that
for monomial ideals $J\subset I\subset S_f$ the number of Stanley spaces in a
Stanley decomposition of $I/J$ is an invariant of $I/J$. For the proof of this
result we introduce Hilbert series for $\ZZ^n$-graded $K$-vector spaces.
