L
Lez
Hi Guys,
I ma very new to dotnet and am working on a custom function, see below:
public static string Saving2(object ProdRRP, object ProdWebPrice)
{
if (ProdRRP == null || ProdWebPrice == null)
{
return "";
}
else
{
Double ProdRRPNew = Convert.ToDouble(ProdRRP);
Double ProdWebPriceNew = Convert.ToDouble(ProdWebPrice);
Double Saving = Math.Round (Convert.ToDouble(ProdWebPriceNew -
ProdRRPNew),2);
if (Convert.ToInt32(Saving) ==0)
{
return "";
}
else
{
return "Save " + Saving.ToString("c");
}
}
}
This shows a saving relevant to the RRP price as a £value. Can anyone tell
me how I get it to calculate as a % of the RRP price?
Thanks in advance
I ma very new to dotnet and am working on a custom function, see below:
public static string Saving2(object ProdRRP, object ProdWebPrice)
{
if (ProdRRP == null || ProdWebPrice == null)
{
return "";
}
else
{
Double ProdRRPNew = Convert.ToDouble(ProdRRP);
Double ProdWebPriceNew = Convert.ToDouble(ProdWebPrice);
Double Saving = Math.Round (Convert.ToDouble(ProdWebPriceNew -
ProdRRPNew),2);
if (Convert.ToInt32(Saving) ==0)
{
return "";
}
else
{
return "Save " + Saving.ToString("c");
}
}
}
This shows a saving relevant to the RRP price as a £value. Can anyone tell
me how I get it to calculate as a % of the RRP price?
Thanks in advance