Most sources quote ranges from about 10 watt-hours to 25 watt-hours per mile. For instance,
this.
Let's say 20 watt-hours per mile.
Let's say electricity cost you $0.20 per kilo-watt-hour, which is more than even CA according to
this.
Let's say your charger is only 85% efficient.
(20/1,000 * $0.20) / 0.85 = $0.0047 * 100 (cents/dollar) = about half a cent per mile.
To calculate the battery capital cost amortized over the useful life, one first has to define "useful life." Typical numbers are 500 cycles after which you have 80% of the original battery capacity per charge. A "cycle" is defined as a 0% to 100% charge, so charging from 50% to 100% is just a half cycle.
Battery prices vary from cheap no-name to expensive mandated-by-manufacturer European. Skipping Aliexpress, even on Amazon one can buy a
48V 20AH battery (960 watt-hour) in the typical shark shape for $300. A
Luna X2 replacement battery (48v 17.5AH, or 840 watt-hour) costs $650. A
Bosch Powerpack 500 battery (500 watt-hour) can cost $775. The range per watt-hour, therefore, is from $0.32/wh to $0.77/wh to $1.55/wh.
Let's pick a $0.90/wh and 500 watt-hours of capacity, but you can pick any combo that applies to your situation. The battery would cost $450, and for its 500 cycles that would be 500wh*500 = 250,000wh / 20wh/mile = 12,500 miles. So, $450/12,500 = $0.036/mile, or 3.6 cents/mile.
So, 0.47 cents/mile to charge plus 3.6 cents/mile to buy is just over
4 cents/mile all in, assuming you take the battery to get recycled when you're done and don't find another use for it. Proving
@circuitsmith's above statement correct by an order of magnitude.