#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    112
    Rep Power
    6

    Calculation question


    How would you correctly express this?

    PHP Code:
    if ($hours 40)
        {
            (((
    $hours $wages) + (($hours 40) * $wages 1.5)) = $bonus_amt);
        }
        else
        {
            ((
    $hours $wages) = $weekly_pay);
        } 
    I am trying to apply the calculation = $bonus_amt and $weekly_pay but I know this is not correct.
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    The variable you're setting goes on the left.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    Jersey
    Posts
    16
    Rep Power
    0
    Just to further elaborate on the previous response you want something like this

    PHP Code:
    if ($hours 40
        { 
             
    $bonus_amt = ($hours $wages) + (($hours 40) * $wages 1.5); 
        } 
        else 
        { 
            
    $weekly_pay $hours $wages
        } 

IMN logo majestic logo threadwatch logo seochat tools logo