Variables

Feb 26, 2013

I am trying to use a variable where I multiply the cost of a pack of cigarettes times the number of packs smoked in a month adn then in a year.  I have used Numeric entry for the learner to enter the number of packs.  The calculation works but the calculated number appears in the Numeric Entry box not the Monthy cost box.  I have attached a picture of my triggers and variables. Can you tell me what I am doing wrong?

8 Replies
Sam Carter

I added a slide that makes it work.  I wonder if it can be simpler?

I had to add two triggers EACH for variables changing: PacksPerDay and PricePerPack

The first trigger copies the value to variable CostPerDay

The second trigger multiples CostPerDay by the other variable.  e.g., CostPerDay = PacksPerDay * PricePerPack

Variables MonthlyCost and AnnualCost EACH have two triggers:

The first trigger copies CostPerDay to MonthlyCost (and AnnualCost)

The second trigger multiples MonthlyCost by 30, AnnualCost by 365

Some cleanup could be done to ensure that cents "$nn.00" are always shown, or not.

Sam Carter

Carolyn,

I've been thinking of this problem, and without a mechanism in Storyline to specify digits in numeric fields, we've painted our way into a corner.

The only way out that I can see is to resort to text fields which compounds the solution quite a lot.  Using text fields to display the result, we could add logic to round numbers to whole values.

Does anyone see a simpler solution?

Sam

This discussion is closed. You can start a new discussion or contact Articulate Support.