decTotalCost = intNumDays * decLocationFee + decRegistrationFee
lstCost.Items.Add(decTotalCost).ToString("c")
in the statement above, the right amount is sent to lstCost, but not as a ("c") or a decimal, any suggestions?
decTotalCost = intNumDays * decLocationFee + decRegistrationFee
lstCost.Items.Add(decTotalCost).ToString("c")
in the statement above, the right amount is sent to lstCost, but not as a ("c") or a decimal, any suggestions?
Is this what you want? Note how I've done the format without ToString.
private void button1_Click(object sender, EventArgs e)
{
int intNumDays = 8;
decimal decLocationFee = 23.77m;
decimal decRegistrationFee = 12.99m;
decimal decTotalCost = intNumDays * decLocationFee + decRegistrationFee;
lstCost.Items.Add($"{decTotalCost:C}");
}

That looks like it worked, I will give it a shot, I dont think I've learned that method.
Hi @Hekzdaddy-3952 ,
the right amount is sent to lstCost, but not as a ("c") or a decimal,
Change :
lstCost.Items.Add(decTotalCost).ToString("c")
To:
lstCost.Items.Add(decTotalCost.ToString("c"))
Best Regards,
Jack
11 people are following this question.