Example #1
0
        public static SalaryData CalculateSalaryDataByMonthlySalary(double yourMonthlySalary)
        {
            var result = new SalaryData { PerMonth = yourMonthlySalary };

            var secondsInMonth = TimeSpan.FromDays(31).TotalSeconds;

            result.PerSecond = yourMonthlySalary / secondsInMonth;
            result.PerMinute = result.PerSecond * 60;
            result.PerHour = result.PerMinute * 60;
            result.PerDay = result.PerHour * 24;
            result.PerWeek = result.PerDay * 7;
            result.PerYear = result.PerMonth * 12;

            return result;
        }
Example #2
0
        public static SalaryData CalculateSalaryDataByMonthlySalary(double yourMonthlySalary)
        {
            var result = new SalaryData {
                PerMonth = yourMonthlySalary
            };

            var secondsInMonth = TimeSpan.FromDays(31).TotalSeconds;

            result.PerSecond = yourMonthlySalary / secondsInMonth;
            result.PerMinute = result.PerSecond * 60;
            result.PerHour   = result.PerMinute * 60;
            result.PerDay    = result.PerHour * 24;
            result.PerWeek   = result.PerDay * 7;
            result.PerYear   = result.PerMonth * 12;

            return(result);
        }