cash multipler

Moderators: Disciple, zlovatt

Post Reply
lowtech19
Posts: 3
Joined: January 28th, 2010, 9:34 am

March 9th, 2011, 2:09 pm

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).
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

March 21st, 2011, 12:16 pm

So why don't you just do exactly that? y * x
RexanaCCf
Posts: 3
Joined: October 4th, 2014, 7:36 pm

October 9th, 2014, 4:13 am

I have same problem with you lowtech19. Have you figure it out?
beginUndoGroup
Posts: 81
Joined: November 27th, 2012, 6:41 am

October 10th, 2014, 12:32 am

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.
Post Reply