Page 1 of 1

cash multipler

Posted: March 9th, 2011, 2:09 pm
by lowtech19
i need to create an expression that will take a cash value of (y) Y= $1.28 and have it multiplied by (x). X needs to be connected to a slider or something i can key... this way i can key a single slider to just multiple the value of (y) * (x).

Re: cash multipler

Posted: March 21st, 2011, 12:16 pm
by lloydalvarez
So why don't you just do exactly that? y * x

Re: cash multipler

Posted: October 9th, 2014, 4:13 am
by RexanaCCf
I have same problem with you lowtech19. Have you figure it out?

Re: cash multipler

Posted: October 10th, 2014, 12:32 am
by beginUndoGroup
Avoid multiplying a number with a string.
If you have the possibility, put x and y on separate sliders, and in your text put an expression that formats x*y into what you want, for instance

x=thisLayer.effect("x").slider;
y=thisLayer.effect("y").slider;
"$" + (x*y).toFixed(2);

If you can't (ie the textLayer already has a text of the form $1.28), then
// y is the numeric value carried by the text
x=thisLayer.effect("x").slider;
y = parseFloat(thisLayer.text.value.slice(1));
"$" + (x*y).toFixed(2);

Xavier.