I just figured out costs per mile. Take what your car cost, including financing, repairs so far, insurance and registration for the life of the car, and estimated repairs. Thats the money, then take the miles you have driven, and how many miles you expect to keep the car. Thats the miles. Then take an average price of gas, $4.00 awhile back, $2.50 now, so call it $3.00 mabye? Multiply the number of gallons your projected miles take by the cost of gas, and add to the money. Then you can divide to get a cost per mile. If you have the car paid for, you can do the same calculation just using the numbers you know from the past, but cost of ownership changes once you don't have payments, so depending on the car, projecting costs may be more accurate than current costs if you have a payment.
For me cost per mile depended on the car, A 2000 ford focus was costing us about 35 cents a mile, a 1998 subaru forester was costing about 45 cents since it had more miles and broke down more. A 1988 one ton pickup was costing at least a dollar per mile.

I knew the truck was costly, but wow! When it breaks down, parts for that size truck are very costly. Gas wasn't as big a deal as I thought, it was repairs.
Similar calculations for the bike came out to about 10 cents per mile for the ebike. That could be less if the battery goes over 10,000 miles but I felt basing the calculation on 1000 ten mile cycles made sense. So my 30 mile round trip costs me about $13.50 in the subaru. In reality about $15 since I will drive further to shop. And the bike trip costs me $3. So every day I ride the bike pays me $13 or so. It takes me an extra hour, so I'd make more by working an extra hour, but I enyjoy the bike ride a lot more!
I figure for most folks, riding the ebike would pay you about 80-90 cents per mile. Not bad, considering that you are saving the planet, saving your health if you pedal even a little, and can feel that good about both.
If my only other vehicle was the truck though, I'd be making 20 bucks an hour to ride the bike.