Jump to content


Photo

Need to figure out variable Y & structure to define in PHP


Best Answer n1concepts, 02 March 2013 - 11:50 AM

I figured it out - simple math (had to step thru to get to 2nd step).

Always, look for the simple method/answer...:)

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 n1concepts

n1concepts

    Advanced Member

  • Members
  • PipPipPip
  • 167 posts

Posted 02 March 2013 - 10:42 AM

Hi,

 

I need some help to define a math equation, in PHP, that will determine the variable $y.

Example: (1.60 multiplied by  718) then divided by 3550 equals 0.328 (rounded up)

 

Equation: (1.60 * 718) / 3500 = 0.328

----

 

What i need to do is define a PHP formatted equation that will pass in the following:

 

$p = 1.60;

$c = 3500;

$e = 0.328

 

Which will then determine $y (which in the above example is 718)?

Note: should either of the other three variables change ($p, $c, $e), then $y value will dynamically adjust accordingly.

------

 

Any insight on how this can be defined in PHP appreciation - thx!

Note: I know the format - already stated - will work in PHP; I need to figure out how to render $y based on other known variables ($p, $c, $e)

 

That's my issue and my calucations - even knowing 718 is the answer based on those plugged in values - is unknown.

 

thx!



#2 rgopal101

rgopal101

    Member

  • Members
  • PipPip
  • 11 posts

Posted 02 March 2013 - 10:56 AM

Try This

 

$y=($p * $c) / $e ;



#3 n1concepts

n1concepts

    Advanced Member

  • Members
  • PipPipPip
  • 167 posts

Posted 02 March 2013 - 11:08 AM

Thanks but that doesn't yield 718; intead 17073.

 

I know this should be simple to define but guess I've been out of school too dog-gone long... LOL!!!!

I'll continue to play w/it until i figure it out but thanks!



#4 n1concepts

n1concepts

    Advanced Member

  • Members
  • PipPipPip
  • 167 posts

Posted 02 March 2013 - 11:50 AM   Best Answer

I figured it out - simple math (had to step thru to get to 2nd step).

Always, look for the simple method/answer...:)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com