The problem with the above is that while it would be nice if it were that simple, it isn't. The range estimator has earned the nickname "Guess O Meter" because of its inaccuracy in multiple EVs. In the gen I Leaf, for example, it just takes the last few minutes of energy consumption the last time the car was driven, and extrapolates that into available range. This ONLY works out when the last few minutes of driving just happened to consume energy at the same rate as the average rate for a typical drive by the car's owner. Most often what happens is you get a wildly optimistic estimate based on the car being driven gently to a stop and parked. Sometimes, in dealership lots especially, you will see a pessimistic range estimate based on lead-footed test drivers' energy use. So while the capacity bars are usually roughly correct*, the range estimate is nearly useless when car shopping.
Speaking of which, I suggest you read my used Leaf buying guide:
https://www.mynissanleaf.com/viewtopic. ... 2&p=538030
* Capacity bars can be reset to a full, incorrect reading of 12, by rebooting the car's Battery Management System, or BMS. Even when not tampered with, the 12th (sometimes also know as the first) bar is worth fully 15% of the battery's capacity, while subsequent bars are worth only about 6% each. Thus a "12 bar" Leaf can have between 85% and 99.9% of full capacity.