Definition of the order of a meromorphic function Let $X$ be a complex manifold and $Y \subset X$ a hypersurface.  Let $x \in Y$ and $f$ a meromorphic function on $X$ near $x$.  In Huybrecht's Complex Geometry the order of $f$ along $Y$ at $x$ is defined as
$$
f = g^{ord_{Y,x}(f)} \cdot h
$$
where $h \in \mathcal O_{X,x}^*$, the sheaf of germs of nonvanishing sections on $x$, and $g\in \mathcal O_{X,x}$ is irreducible and defines $Y$ near $x$.
I'm having trouble coming to grips with this definition.  Consider the case $X = \mathbb C^2$ with coordinates $(z_1,z_2)$ and $Y = \{z_1 = 0\}$.  Then what is $ord_{Y,(0,0)} z_2$?  It seems impossible to write $z_2 = z_1^d h$ for some $h \in \mathcal O_{X,x}^*$.  Further, it is stated that the order at any point on an irreducible hypersurface is independent of the point.  But clearly $ord_{Y,x} z_2 = 0$ if $x \ne (0,0)$.  So if the order is 0 at (0,0) as well, then this is saying that $z_2 \in \mathcal O_{X,(0,0)}^*$.  What am I missing?
Thanks.
 A: Everything becomes crystal-clear once you recall: 
$$\large \mathcal O_{X,x}  \text {is a UFD} $$
Then if the germ of $Y$ at $x$ is defined by the irreducible element $g\in \mathcal O_{X,x}$, you can write-as in every UFD- any non-zero   $f\in  \mathcal M_x=Frac(O_{X,x})$    uniquely as:
 $$f=g^n\Pi h^{n_h}=g^n (stuff)    \quad (*)$$ where
- the $h$'s are pairwise non associated and run through the irreducibles of  $\mathcal O_{X,x}$ not associated to $g$,
- $n,n_h\in \mathbb Z$ are almost all zero (  "unicity" is up to order of factors and up to invertible elements, as usual in a UFD) .
The order of $f$ along $Y$ at $x$ is then, very naturally, the exponent $n$ of $g$ in $(*)$.
In your example $z_1$ and $z_2$ are two non-asociated irreducibles so that if $Y$is defined locally by $z_1=0$, you write $f=z_2=(z^1)^0.( stuff)$ and you get that the order of vanishing of $z_2$ along $Y$ is $0$
[of course $(\text stuff)=z_2$, but that's irrelevant!]
Edit QiL's crisp and definitive comment made me want to check Huybrechts's definition.
His Definition 2.3.5.on page 78 states:        
"Let $f$ be a meromorphic function in a neighbourhood of 
$x\in Y$. Then the order  $ord_{Y,x}(f)$ of $f$ in $x$ with respect to$Y$ is given by the equality $f=g^{\text {ord}(f)}.h$ with $h\in \mathcal O^*_{X,x}$." 
This is a completely wrong  definition since it is impossible to find such a factorization of $f$ in general: it would imply in particular that any germ at $x$ of a holomorphic function on $X$ would have a zero set coinciding with $Y$ at $x$, an obviously preposterous conclusion.
A: I think there is actually a problem with this definition. The best one can do is to have $h$ meromorphic and belonging to $\mathcal O_{X,y}^*$ for some $y\in Y$ near $x$. 
The idea is the order of $f$ at $(Y,x)$ is an integer $r$ such that the divisor of $f/g^r$ is not supported in $Y$ in a neighborhood of $x$. 
A: The order function measures the extent to which a meromorphic function $f$ on a complex manifold $X$ vanishes along a codimension one subvariety $Y$.  It appears that your notation for that is $ord_{X,Y}(f)$.
So in my mind, there are two sensible interpretations of your example.  The less likely is that you want $ord_{X,Y}(z_2)$, which is $0$ because $z_2$ is holomorphic on $Y$ and does not vanish identically.  More likely, you want $ord_{Y,(0,0)}(z_2)$, which is $1$ because $Y \cong \mathbb{C}$, with coordinate $z_2$, and of course, $z_2$ vanishes to order $1$.  Said more verbosely, $z_2 = g^1 h$, where $g = z_2$ generates the maximal ideal of germs of functions at $(0,0)$ that vanish there (more colloquially, "$z_2$ defines $(0,0)$ in $Y = 0 \times \mathbb{C}$") and $h = 1$ is an invertible germ (i.e. $h(0,0) \neq 0$).
Please note that if $x \in X$, where $X$ is a complex manifold, then the defintion $ord_{X,x}(f)$ only makes sense if $\dim X = 1$.
