当前位置: 首页>>代码示例>>C#>>正文


C# Int64.ToDouble方法代码示例

本文整理汇总了C#中System.Int64.ToDouble方法的典型用法代码示例。如果您正苦于以下问题:C# Int64.ToDouble方法的具体用法?C# Int64.ToDouble怎么用?C# Int64.ToDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Int64的用法示例。


在下文中一共展示了Int64.ToDouble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddTaxes

		private void AddTaxes(Millicents GrossForFICA, Millicents GrossForFed, Millicents GrossForState, Millicents GrossForLocal, Income income, Person person)
		{
			person.UpdateIncomeTaxStatusByDate(0/*JulianDay*/);
			IncomeTaxStatus status = person.IncomeTaxStatus;
			TaxTable federal = TaxTable.CreateFederal(status);
			TaxTable state = TaxTable.CreateState(status, person.Location);
			TaxTable local = TaxTable.CreateLocal(status, person.Location);

			double AnnualPayPeriods = income.Frequency.ToAnnualPeriods();

			// FICA
			double GrossFICA = GrossForFICA.ToDouble();
			double SocSecWages = Math.Min(GrossFICA, Math.Max(TaxTable.MaxSocSecWages - GrossFICA, 0));
			double SocSec = Math.Round(SocSecWages * TaxTable.SocSecPercent, 2);
			double Medicare = Math.Round(GrossFICA * TaxTable.MedicarePercent, 2);

			// Federal
			double FederalGross = GrossForFed.ToDouble() * AnnualPayPeriods;
			double FederalExemptions = federal.Exemptions(status.FederalExemptions);
			double FederalTaxableGross = Math.Max(FederalGross - FederalExemptions, 0);
			double FederalTaxTotal = Math.Round(federal.Compute(FederalTaxableGross), 2);
			double FederalTax = Math.Round(FederalTaxTotal / AnnualPayPeriods, 2);

			// State
			double StateGross = GrossForState.ToDouble() * AnnualPayPeriods;
			double StateExemptions = state.Exemptions(status.StateLocalExemptions);
			double StateTaxableGross = Math.Max(StateGross - StateExemptions, 0);
			double StateTaxTotal = Math.Round(state.Compute(StateTaxableGross), 2);
			double StateTax = Math.Round(StateTaxTotal / AnnualPayPeriods, 2);

			// Local
			double LocalGross = GrossForLocal.ToDouble() * AnnualPayPeriods;
			double LocalExemptions = local.Exemptions(status.StateLocalExemptions);
			double LocalTaxableGross = Math.Max(LocalGross - LocalExemptions, 0);
			double LocalTaxTotal = Math.Round(local.Compute(LocalTaxableGross), 2);
			double LocalTax = Math.Round(LocalTaxTotal / AnnualPayPeriods, 2);

			// Other calculations
			//double NetPay = GrossFed - SocSec - Medicare - FedTax - StateTax;
			//double AvgTaxRate = (SocSec + Medicare + FedTax + StateTax) / GrossFed;
			//double CompanyPayrollTaxes = FedTax + (2*SocSec )+ (2*Medicare);
			//double CompanyLiability = GrossFed + SocSec + Medicare;

			// If the income is not exempt, add the tax transactions
			if (!income.TaxExempt.FICA && SocSec != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: SS", SocSec.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.FICA && Medicare != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Medicare", Medicare.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.Federal && FederalTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Federal", FederalTax.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.State && StateTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: State", StateTax.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.Local && LocalTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Local", LocalTax.ToMillicents(), income.Frequency, income.TargetAccount));
		}
开发者ID:,项目名称:,代码行数:55,代码来源:


注:本文中的System.Int64.ToDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。