Forums

This topic is locked

dmx:dividing entered value into several categories

Posted 15 Jan 2003 04:44:18
1
has voted
15 Jan 2003 04:44:18 zoe z posted:
i'm building this money management system and this is how i want it to work:first,users have to enter a value,that is the budget of their expenditure,say $10,000.then,the system must calculate the entered value based on a few categories,say,5 categories and each has its own percentage from the entered value,say category1 10% from the entered value,category2 5% from the entered value and so on.so,how can this be done?i'm using dmx,asp+ javascript,access2000

Replies

Replied 15 Jan 2003 10:31:02
15 Jan 2003 10:31:02 Iain Stewart replied:
hi,

set the user inputed amount to a varible and then just work out the percentage

$total_expen = input_amount

then

$cat1 = $total_expen*0.1 ( for 10% )
$cat2 = $total_expen*0.05 ( for 5% )

etc

if you wanted the user to input percentage amounts set varibles for that and then divide that by a 100 to get your multiplier

$user_input = user_percent
$cat1_percent = $user_input/100

$cat1 = $total_expen*$cat1_percent

it will involve hand coding and i don't know what server model ( ASP/PHP ) your using.

hope this helps

Iain

head hurts, 'mental note to self, stop banging head !'
Replied 17 Jan 2003 04:25:52
17 Jan 2003 04:25:52 zoe z replied:
okay iain,thanx.that helps a bit but it would be better if you could give the code coz you see,i'm still new at this asp thing.for your info,i'm using asp.

Reply to this topic