Jump to content

Percentage vs Currency


Guest trigun

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?

Link to comment
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

Link to comment
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%>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...