Ask a Question related to ASP Database, Design and Development.
-
Laphan #1
Getting an accurate Tax percentage
Hi Guys
Wonder if you can help with my problem that seemed simple enough at first,
but now appears to be a real pain.
Basically I have created a few ASP web pages which have the following form
fields on them:
Net Amount (standard textbox)
Tax Amount (standard textbox)
Tax Rate (drop-down field)
Total Amount (standard textbox)
Allowing the user to populate these fields doesn't prove a problem, my
problem is that when I retrieve the data that they have previously posted, I
need to work out what rate to show (SELECTED) in the Tax Rate drop-down menu
field. This is where the math part comes in.
My plan was to take the Tax Amount divide it by the Net Amount and then
times the result by 100. As an example, please not the following:
a) My Tax Rate drop-down menu will have a rate of 17.5.
b) My Net Amount is 200.00
c) My Tax Amount is 35.00
d) 35.00 / 200.00 * 100 = 17.5 <<< bingo I say, however:
Lets say my Net Amount is 5.00 and my Tax Amount is 0.88 I get 17.6 and if I
go for a Tax Amount of 0.87 I get 17.4.
How can I get round this?
For your ref, I'm using a MySQL DB that has the Net Amount and Tax Amount
set to a decimal data type with 3 decimal places.
Can you give me an idea of what calc I can use (ASP friendly would be really
nice) to get a more accurate output.
Thanks
Laphan
Laphan Guest
-
How accurate is the overprint preview?
I am looking for a bright red PMS to be overprinted on tan paper (Desert Storm which is close to PMS 7503.) When I simulate the tan paper color using... -
Displaying as a percentage
In my SQL Query I am selecting two fields from an Access database, both of which are numbers. I am then dividing the two together and using AS to... -
Accurate PMS on Epson 1290? Mac OSX.3.3
Hello everyone.. I've been having colour problems with getting accurate PMS colours out of the Epson 1290 and freehand 11/illustrator v10 Does... -
Co-odinates not accurate!!!!
0S.9.2 I have a page in QuarkXpress 4.1which has a flat colour (PMS288) in a picture box. Another picture box sits on top of this whose... -
Clipping Path Is Not Accurate
When I create a clipping path in Photoshop then bring it into Illustrator, the path is not as accurate as the one i crreated in Photoshop. How can I... -
Manohar Kamath [MVP] #2
Re: Getting an accurate Tax percentage
My suggestion would be not to do the calculation in the database, but in the
ASP script. The FormatNumber function can format your output to decimal
places as needed:
FormatNumber(TaxAmount/NetAmount * 100, 3)
--
Manohar Kamath
Editor, .netWire
[url]www.dotnetwire.com[/url]
"Laphan" <news@DoNotEmailMe.co.uk> wrote in message
news:4106c7c2_3@127.0.0.1...I> Hi Guys
>
> Wonder if you can help with my problem that seemed simple enough at first,
> but now appears to be a real pain.
>
> Basically I have created a few ASP web pages which have the following form
> fields on them:
>
> Net Amount (standard textbox)
> Tax Amount (standard textbox)
> Tax Rate (drop-down field)
> Total Amount (standard textbox)
>
> Allowing the user to populate these fields doesn't prove a problem, my
> problem is that when I retrieve the data that they have previously posted,menu> need to work out what rate to show (SELECTED) in the Tax Rate drop-downI> field. This is where the math part comes in.
>
> My plan was to take the Tax Amount divide it by the Net Amount and then
> times the result by 100. As an example, please not the following:
>
> a) My Tax Rate drop-down menu will have a rate of 17.5.
>
> b) My Net Amount is 200.00
>
> c) My Tax Amount is 35.00
>
> d) 35.00 / 200.00 * 100 = 17.5 <<< bingo I say, however:
>
>
> Lets say my Net Amount is 5.00 and my Tax Amount is 0.88 I get 17.6 and ifreally> go for a Tax Amount of 0.87 I get 17.4.
>
> How can I get round this?
>
> For your ref, I'm using a MySQL DB that has the Net Amount and Tax Amount
> set to a decimal data type with 3 decimal places.
>
> Can you give me an idea of what calc I can use (ASP friendly would be> nice) to get a more accurate output.
>
> Thanks
>
> Laphan
>
>
>
>
Manohar Kamath [MVP] Guest



Reply With Quote

