Let the mass of the planet be m and the mass of the sun be M. We can assume that the radius of the planet's orbit is the distance between the centre of the sun and the centre of the planet, that is, the radius of the sun is negligible compared to its distance from the planet.
Gravitational force between the sun and planet = GMm/r2,
where G is the gravitational constant=6.67E-11Nm2/kg2 and r=7.73E11m.
The circular motion creates a centripetal force on the planet=mv2/r, where v is the velocity.
These two forces are equal and opposite:
GMm/r2=mv2/r. The length of the orbit is 2πr and the planet takes time T (orbital period) to travel a complete orbit, therefore T=2πr/v, so v=2πr/T. The centripetal force is 4π2rm/T2.
GMm/r2=4π2rm/T2, M=4π2r3/(GT2).
r3=4.6189E35 or 4.6189×1035 m3. T2=5.1984E14 s2.
M=(4π2)(4.6189E35)/(6.67E-11×5.1984E14)=5.259E32kg.
So the mass of the sun is 5.259×1029 metric tonnes.