Last active
August 29, 2015 14:26
-
-
Save jwynia/dd85514cf7604f70e18b to your computer and use it in GitHub Desktop.
Extended Driving Commute Formula
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Sample rate of $75 for demonstration purposes. | |
| var rate = 75; | |
| var nominalDayHours= 8; | |
| var driveTimeEachWay = 62; | |
| var allowedTimeEachWay = 30; | |
| //2015 IRS rate of $0.575 per mile | |
| decimal irsMileage = 0.575M; | |
| decimal overage = (driveTimeEachWay - allowedTimeEachWay) * 2; | |
| decimal mileageAdjustment = overage * irsMileage; | |
| decimal fractionOfHour = overage/60; | |
| var drivingDollars = rate * fractionOfHour; | |
| var adjustedDollars = (rate * nominalDayHours) + drivingDollars + mileageAdjustment; | |
| var adjustedRate = adjustedDollars / nominalDayHours; | |
| Console.WriteLine(Math.Round(adjustedRate)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment