Tesla knows it. Volvo knows it. Hell, most of the automotive industry knows it. At this point, electric cars are inevitable. But how quickly will they usurp our current gas guzzlers?

A new analysis from Bloomberg New Energy Finance tries to quantify exactly that. Its forecasts aim to predict the changes in price of buying and running electric vehicles in the future, and also consider government initiatives for encouraging adoption and automaker goals for launches and sales.

The main prediction to take away from the analysis: by 2040, 54 percent of new cars sold will be electric. That’s up from the 35 percent that the organization predicted just over a year ago. It's worth taking a moment to let that figure sink in: if the numbers are correct, electricity would be the dominant fuel type across all newly sold cars.

There’s clearly a long way to go yet, not least because the market for all-electric cars is still minuscule, accounting for less than 1 percent of sales in 2016. But the trend is pointing sharply upward—global sales of plug-in vehicles rose to 191,700 in the first quarter of 2017, 40 percent more than the same period last year.

The main reason for the optimistic new predictions is battery pricing. The cost of lithium-ion batteries per kilowatt-hour fell by 65 percent between 2010 and 2015 (see chart), and BNEF predicts that it will fall by another 70 percent between now and 2029. That, it says, will make electric cars cheaper to both run and purchase.

For most people, it’s true that it will ultimately be cold hard cash that encourages them to ditch internal combustion for electrons. But governments still have a role to play in encouraging adoption, by building out charging infrastructure and banning the most polluting of cars from the roads. Without those incentives, BNEF’s estimates could yet prove overly optimistic.

(Read more: Electric Vehicle Outlook 2017, “Here’s How to Speed Up the Electric-Car Revolution,” “ The 2020s Could Be the Decade When Electric Cars Take Over,” “Electric Superhighways Can’t Come Soon Enough”)