I'm looking for a function that depends on B, C values. B is a real value, C is a % from 0 to 100.
I need the C value to apply a % if B is positive so A= $ B . \frac{C}{100}$ . If B=100 and C=99% -> A = 99 ... If B=100 and C=0% -> A = 0
The thing is that I need the function to also make C apply a % reduction if B is negative.
For example, if B=-100 and C=99% I get A= -99 ... but I need C to apply a 99% reduction so the result is A = -1.
The closest function I came up with (I confess I'm no expert) is A= $ \frac{|B| + B}{2} - B (1-\frac{C}{100}$). But the signs don't match at the end.
Does a function that meets those two conditions exist? Or I will need to separate it in B≥0 and B<0?