Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: solving for x
by mojotoad (Monsignor) on Nov 18, 2004 at 21:09 UTC
    If you pay me $133.42, I'll show you how I calculated that fee.

    ;)
    Matt

    P.S. this might be of assistance.

Re: solving for x
by ikegami (Patriarch) on Nov 18, 2004 at 21:26 UTC

    I'm not sure in which of the following two paragraphs you are interested. Pick the one that applies.

    If the site takes a percentage (say 12%) of the total:
    $freelancers_fee = $total * (1 - $site_cut)
    which is equivalen to
    $total = $freelancers_fee / (1 - $site_cut)
    Example: Site charges $150, leaving $132 for the freelancer.
    Example: Freelancer wants $100, meaning the price has to be $113.64

    If the site takes a percentage (say 12%) of the freelancers's fee:
    $total = $freelancers_fee * (1 + $site_cut)
    which is equivalen to
    $artist_fee = $total / (1 + $site_cut)
    Example: Freelancer charges $100, bringing the total to $112
    Example: Freelancer wants the site to charge $150, leaving $133.93 for the freelancer.

Re: solving for x
by Fletch (Bishop) on Nov 18, 2004 at 21:15 UTC
    my $desired = 100; my $overhead = 12.70; print "You need to charge: ", $desired + $overhead, "\n";

    You owe the Oracle your elementary school math teacher's teaching certificate.

Re: solving for x
by ysth (Canon) on Nov 18, 2004 at 21:23 UTC
    $percentage = 13; $desired_net = 100; $charge = sprintf "%.2f", $desired_net / (1 - $percentage/100); $charge = sprintf "%.2f", $charge + .01 if $charge * (1-$percentage/100) +.5 < $desired_net;
    (Update: added +.5, assuming reasonable rounding on the part of the site)
Re: solving for x
by artist (Parson) on Nov 18, 2004 at 21:21 UTC
    my $percentage = 12.7; my $wanted_to_charge = 100; my $need_to_charge = $wanted_to_charge * ( 1+ $percentage/100);
      That is right if the percentage is calculated relative to the net. Usually, it's done as a percentage of the total charge. Example:
      My company bills the client $60/hour, and takes 20% of that, leaving me 80% of $60, or $48 per hour. If I want the net to me to be $60, the equation is:
      .8 * X = 60 ...solving for X... X = 60 / .8 = 75 ... or more generally: Gross_Charge = Net_Pay / (100 - percentage)%

      No Perl code was harmed -- or even used -- in the production of this post.
Re: solving for x
by terra incognita (Pilgrim) on Nov 18, 2004 at 22:37 UTC
    I think there is some confusion with what you wanted. There are two numbers you could want with this answer, I believe that you want markup required rather than the profit margin. The difference is subtle.
    Profit is a percentage of the cost to you. $profit = $takehome + (100*$percentage); 112.7 = 100 + (100 * .127) Markup is a percentage of the selling price. $markup = $takehome / (1- $percentage); 114.5475 = 100 / (1 - .127)