Formal charge on atom in a molecule= (total no. of valence electrons in the free atom)- (total no. of non-bonding electrons)-1/2 (total no. of bonding electrons)
Formal charge on double bonded O atom =6–4–0.5(4)=0
Formal charge on single bonded O atom=6–6–0.5(2)=−1