1. Junior Member
Join Date
Dec 1969
Posts
9

Alright, Im Making A Game, And In It Prices Of Metals Fluctuate Daily,<BR>The &#039;Base&#039; Price And Volume Is 1000lbs And \$50.00 If The Volume Doubles The Price Is Cut In Half, If It The Volume Is Cut In Half The Price Doubles, <BR>Example:<BR>VOL:2000lbs, PRI: \$25.00<BR>VOL:1000lbs, PRI: \$50.00<BR>VOL:500lbs, PRI: \$100.00<BR><BR>What I Do Know Is, Is &#039;Yesterdays Price&#039;, AND &#039;Total Volume&#039;, And I Need A Formula That Will Give Me &#039;Todays Price&#039;, Is There A Math Formula, Or ASP Function That Will Do That?

2. Senior Member
Join Date
Dec 1969
Posts
96,118

Oh, come on!

YOU do the math (show your work!) and if you can&#039;t convert it to VBScript (*NOT* ASP...ASP isn&#039;t a language) then show us what you have so far and we can help.<BR><BR>But we don&#039;t do homework, as a general rule.<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
96,118

And you need more than that!

I ... Know ... &#039;Yesterdays Price&#039;, AND &#039;Total Volume&#039;<BR><BR>How does that help? You need Yesterday&#039;s Volume *and* Today&#039;s Volume.<BR><BR>As well as Yesterday&#039;s Price.<BR><BR>

4. Junior Member
Join Date
Dec 1969
Posts
9

RE: Oh, come on!

5. Junior Member
Join Date
Dec 1969
Posts
9

RE: And you need more than that!

alright, i can get yesterdays volume and todays volume

6. Senior Member
Join Date
Dec 1969
Posts
2,049

RE: question?

Wouldn&#039;t you just take the total number of transactions yesterday and divide them by the total?<BR><BR><BR>&#060;%<BR>Dim str<BR>str = Array("50","25","25","100","100")<BR><BR>Dim i<BR>For i = 0 To UBound(str)<BR> prc = int( Prc + str(i) )<BR>Next<BR><BR>Response.Write( prc / int(UBound(str)+1) )<BR>&#039; Result 60<BR>%&#062;

7. Junior Member
Join Date
Dec 1969
Posts
9

RE: question?

because i dont have the total number of transactions just the total, see every user has a certain amount of metal say jon has 100lbs and bob has 1000lbs i just get the amount of all the metals...what there doin in the game is searchin for the metals, proccessing them, then selling them according to todays price...

8. Senior Member
Join Date
Dec 1969
Posts
1,843

Sorry, a little humorous

"An ASP Function"<BR><BR>I&#039;m sure the architects of VBS many years ago said "Hey, we need Split() and Replace() and Instr() And a function that will take "Yesterdays Price" of a metal and compare it to the "total volume" to see what "todays price" should be"<BR><BR>heheheheheh.

9. Junior Member
Join Date
Dec 1969
Posts
9

RE: Sorry, a little humorous

Well They Are Dumb, They Should Have, And It Would Have Made My Live Much Easier! :)

10. Senior Member
Join Date
Dec 1969
Posts
2,049

RE: Ummm

I suggest keeping track of the transactions.<BR>Otherwise impossible.<BR><BR>50 - 1000<BR>25 - 2000<BR>25 - 2000<BR>100 - 500<BR>100 - 500<BR>---------<BR>300 - 6000 <BR><BR>6000 / 300 = 20<BR><BR>300 / 5 = 60 &#039; This is correct.<BR><BR><BR>good luck

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•