E
EddWood
Hi Guys,
I am new to dotnet and have this custom function to show a £value saving
based on the ProdPrice and ProdWPrice which works fine, but I am looking for
the value to be shown as a percentage % rather that a £value for another
function.
public static string saving(object ProdPrice, object ProdWPrice)
{
if (ProdPrice == null || ProdWPrice == null)
{
return "";
}
else
{
Double ProdPriceNew = Convert.ToDouble(ProdPrice);
Double ProdWPriceNew = Convert.ToDouble(ProdWPrice);
Double Saving = Math.Round (Convert.ToDouble(ProdWPriceNew -
ProdPriceNew),2);
if (Convert.ToInt32(Saving) <=0)
{
return "";
}
else
{
return "Save " + Saving.ToString("c");
}
}
Thanks
}
I am new to dotnet and have this custom function to show a £value saving
based on the ProdPrice and ProdWPrice which works fine, but I am looking for
the value to be shown as a percentage % rather that a £value for another
function.
public static string saving(object ProdPrice, object ProdWPrice)
{
if (ProdPrice == null || ProdWPrice == null)
{
return "";
}
else
{
Double ProdPriceNew = Convert.ToDouble(ProdPrice);
Double ProdWPriceNew = Convert.ToDouble(ProdWPrice);
Double Saving = Math.Round (Convert.ToDouble(ProdWPriceNew -
ProdPriceNew),2);
if (Convert.ToInt32(Saving) <=0)
{
return "";
}
else
{
return "Save " + Saving.ToString("c");
}
}
Thanks
}