Metformin can deplete B 12 and many of us take a supplement. Usually leg cramps may be caused by dehydration or too low levels of electrolytes like magnesium and potassium. Start to eat foods high in potassium and magnesium like avacado, spinach, almonds, lower carb V-8 juice, greek yogurt, etc. You may need some supplements. If you mainly get the leg cramps at night try an old wives tale of a bar of soap at the bottom of the bed. Don't ask me how it works but some swear by it. I take 2550 mg of metformin and have never had a problem with cramps. I do get Restless Leg syndrome once in awhile when my diet is out of whack.