【发布时间】:2017-09-27 14:12:28
【问题描述】:
试图让自己成为一个无需售价即可计算毛利润的小型工作项目。谁能解释为什么这被标记下来?在某一时刻,我们都需要帮助..
我目前有 4 个文本框,成本、销售、毛利率、加价
我通常如何做到这一点,它擅长的是 =Cost/(1-Gp Markup),这将返回 14.99 美元,以 12.74 美元的成本出售,例如 @ 15%
我的代码低于任何帮助将不胜感激:)
private void button2_Click(object sender, EventArgs e)
{
double cost = Convert.ToDouble(costTextBox.Text);
double grossmargin = Convert.ToDouble(grossmarginTextBox.Text);
double grossSellFinal = cost + (cost * grossmargin)/100;
// This returns $14.65 which is a mark up not gross profit
sellTextBox.Text = grossSellFinal.ToString();
}
我也试过了
private void button2_Click(object sender, EventArgs e)
{
double cost = Convert.ToDouble(costTextBox.Text);
double grossmargin = Convert.ToDouble(grossmarginTextBox.Text);
double grossSellFinal = cost / (1 - grossmargin);
//This returns a sell of -0.91
sellTextBox.Text = grossSellFinal.ToString();
}
【问题讨论】:
-
您收到什么结果?或者哪些错误?
-
嗨 Shultc,没有错误只是得到错误的答案。正确答案应该是卖出 14.99 美元 我只能设法得到 14.65 或 0.91,这两个都是不正确的
标签: c# .net accounting