How to convert voltage to current from ACS712-20A?
According to the datasheet you have 100mV per ampere, and a zero offset voltage of Vcc × 0.5.

So assuming you are correctly converting the ADC reading into a floating point voltage the instantaneous current can be calculated with the formula

i = (Vadc - 2.5) × 10


Or for milliamps,

i = (Vadc - 2.5) × 10000


If you are measuring a DC current that is then all well and good.  However, if you are measuring an AC current things get considerably more complex.

To work out an AC current you need to have the peak-to-peak voltage, not the instantaneous voltage.  To get that you need to sample the ADC over a number of cycles and find both the maximum and minimum values.  You can then subtract the minimum from the maximum to give you the peak-to-peak voltage.  That can then give you the peak-to-peak current.

From that you can then calculate the RMS current.