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)