How does GROMACS compute the translational dipoles with gmx current?

GROMACS version:2021.4
GROMACS modification: No
Hi, all,
I want to figure out the realization details of the command gmx current because of the requirements of later works. I want to know how to calculate the translational part (MJ) of the total dipoles. For electrolytes like [BMIM][NTF2] solutions, the component of anions of the MJ is sum{q_i*r_I}? Is r_i the center of mass of the molecules or the charge-weighted center of the molecules? To simplify the question, I use the [BMIM][CL] as an test example, but the translational part of the anion given by GROMACS is little different from the result of my own code when using the same trajectories. For example, at the first frame (i.e., MJ(t=0)), the gmx current :
-1033.72881 -1024.19682 -1027.3512
but my results:
-1037.21 -1027.67 -1030.6 .
Another question is the trajectory must be unfold in the calculations? It means the broken molecules must be made whole and then get its center of mass, and next get its true position just like in the calculations MSDs?
I have read many relevant papers but they do not tell the details of this process. Is there anyone could help me? Thank you in advance!

Best Wishes!
LM