Following Ramanujan's work on modular equations and approximations of π, there are formulas for 1/π of the form, where λ d are singular values that correspond to elliptic curves with complex multiplication, and a, δ are explicit algebraic numbers. In this paper we prove a p−adic version of this formula in terms of the so-called Ramanujan type congruence. In addition, we obtain a new supercongruence result for elliptic curves with complex multiplication.