Raised This Month: $ Target: $400
 0% 

[Solved] Mathematical operation help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-06-2013 , 07:48   [Solved] Mathematical operation help
Reply With Quote #1

I need some math calculation some like this:

[day] - [value]
40 - 8000
41 - 9000
42 - 10000
43 - 11000
44 - 12000
45 - 13000
.....

i tried some like:
PHP Code:
return day == 40 8000 day 1000 / ( day 10 ) ... ??? 

Last edited by dFF; 07-06-2013 at 09:41. Reason: solved
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-06-2013 , 07:57   Re: Mathematical operation help
Reply With Quote #2

Which usage do you need this for ?

What are values for day < 40 ?
Are values increased by 1000 each day after 40 ?
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-06-2013 at 07:58.
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-06-2013 , 08:03   Re: Mathematical operation help
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Are values increased by 1000 each day after 40 ?
Yes.
If day < 40 i used others values - no problem here.

I don't have any idea how to calculate after the day is > 40, increased by 1000 each day, like in example of 1st post.
dFF is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-06-2013 , 08:28   Re: Mathematical operation help
Reply With Quote #4

From your current day extract your base day and multiply it 1000. Then add it up to your base day value.
SpeeDeeR is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-06-2013 , 08:49   Re: Mathematical operation help
Reply With Quote #5

Still no have any iddea
PHP Code:

#define day_calc(%0) ( (%0+1) * 1000 + 8000)

---
value8000 for day 40
value
9000 for day 41
value
10000 for day 42
value
11000 for day 43
value
12000 for day 44
value
13000 for day 45
etc
... 

Last edited by dFF; 07-06-2013 at 08:59.
dFF is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-06-2013 , 09:18   Re: Mathematical operation help
Reply With Quote #6

Dude I've already told you hold it should be done. Can't you follow simple instructions?!
Code:
NewValue = (CurrentDay - BaseDay) * 1000 + BaseDayValue
SpeeDeeR is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-06-2013 , 09:40   Re: Mathematical operation help
Reply With Quote #7

oh, oky. done. Thanks!
dFF is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-06-2013 , 14:48   Re: [Solved] Mathematical operation help
Reply With Quote #8

This is simple math. Find the equation of a straight line.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode