Len's Formula,
1/f=1/di-1/do
when sign convention is used.
& the formula which u are using
1/f=1/di+1/do
when sign convention is not used.
Magnification,
for real image
m= -hi/ho
for virtual image
m= hi/ho
now u must first clarify that is the image real or virtual.