# Percentage vs Currency

## Recommended Posts

I am extracting data from 2 fields, rs(“markup”) is a numeric fieldAnd rs(“cost”) is a currency field.I need to use rs(“markup”) to get a Percentage of rs(“cost”) then add that Percentage to rs(“cost”), then deliver the total as currency.I have tried using FormatPercent, but this delivers un-expected amounts (perhaps due to the decimal point in the currency field??) and delivers the result with a % on the end. Can anybody suggest a way of doing this?

##### Share on other sites

If you want to change a number from a number to a precent you can just write the calculaiton yourself:for example let's take a poll system:Question: Do you like "Shimi"?A1: Yes (4 votes)A2: No (4 votes)How do you calculate the precents of the first answer for example?You take the number of votes for the first answer (4), divide it by the number of the total votes (8) and multiple it by 100:4 : 8 = 0.50.5 * 100 = 50%I'm not quite sure this is what you asked for so if it's not tell me and I will try to help

##### Share on other sites

• 3 weeks later...
I am extracting data from 2 fields, rs(“markup”)  is a numeric fieldAnd rs(“cost”) is a currency field.I need to use rs(“markup”)  to get a Percentage of rs(“cost”) then add that Percentage to rs(“cost”), then deliver the total as currency.I have tried using FormatPercent, but this delivers un-expected amounts (perhaps due to the decimal point in the currency field??) and delivers the result with a % on the end. Can anybody suggest a way of doing this?

TRY THIS:<%Dim TotalCostTotalCost = FormatCurrency(((rs(“markup”) / 100) * rs(“cost”)) + rs(“cost”))Response.Write TotalCost%>