Round or truncate a calculated numeric variable

I am turn CPQuizInfoPointsScored into percentage and display this to the learner. Sometimes it comes out as a whole number and sometimes it shows something like 97.597613269726%, which is not really desirable. When I display the variable in a text box, I use the 'X' and 'maximum length' setting to 3, but this does not appear to have any effect.

Any ideas how I can round off our truncate the computed variable?

Is there a particular reason why you do not use the system variable cpInfoPercentage quiz?

Workaround would need a JS, Math.Floor or Math.round () function

Tags: Adobe Captivate

Similar Questions

  • Mathematical calculations with variables

    I am using Captivate 4.  I need to create a series of slides that allow the user to enter a number.  Based on the number entered, one of the two slides will show (this action advanced I've written successfully) giving them a response.  I need help is the next step.  The mathematical calculations.  The necessary action will take numbers entered by the user, by the number of 40 and a second number to multiply by 8 and then add the two numbers.

    I've named my variable fields where the user will enter the number, but do not know how to write the script for my response.  Any help is greatly appreciated.

    I can provide additional details, you need, just ask

    Thank you!

    Hello

    You must create the user variables to have available in the drop-down list, use the Variables tab in the dialog box with the advanced actions and create v_result. For the most part, I prefer setting the variables, also those of use with first of the ETB. Don't forget to associate the appropriate variables (v_one and v_two) with the ETB under the Advanced tab in the properties of TEB.

    On the other issue, I'll try to create it, but am a little pressed for time. And I almost forgot how to use the interface in CP4, it's so much better to CP5. I made the blog a lot about variables and advanced actions. Take a look at the comments of two introductions to the variables (examples are for CP5, but can be achieved in CP4 too):

    Curious about variables (part 1)

    Unleash the power of variables (part 2)

    Lilybiri

    Sorry, think you're asking on how to trigger the action: you will need to attach to an event. This event can enter a slide or a button, click box.

  • Naming of calculated numeric fields, calculations of series?

    I don't know why it doesn't work, but I'm having a lot of trouble to do what should be a simple calculation to work on Adobe LiveCycle Designer (using v 8.2.1 on Windows XP).  Maybe I'm not in the correct command in JavaScript.  Here's what I do:

    I have create a numeric field on the form, and then go to the tab link and name it 'FieldA '.

    Now, I create a table and the first cell of the value as a numeric.  I go to the Java window, see calculate it and type:

    FieldA / 100

    This returns the correct value without problem.  Then, I put the name of this cell calculated as "Calc1" on the connection tab.

    I then tries to set the value of the second cell, as shown above (from the Java window) to be

    FieldA - Calc1

    However, I get an error message saying "Calc1 accessor is unknown.

    What is my mistake here?

    According to the name of the line, the following should do it:

    Row2.FieldA - Row2.Calc1

  • Is it Possible to use numeric Variables in a String Variable for file names?

    Hi all

    I don't really know how to phrase this question properly, but here's my question.

    I have a DotNet object and method that someone else wrote to write in an Excel file. I want to use something like: "C:\Program Files\WMT\Sequences\ProductX" + Str (StationGlobals.File_Count) + '.arc' in a local or global variable strings, but I always get illegal characters in a filename. " If I put in the name parameter of value-chain file, it works. The numero_fichier variable is a number.

    TIA,

    Jim

    Put the reference in your expression itself, or calculate the value of the second local using another expression that refers to the first local.

    The expression in your first post will work very well when used as an expression if the backslashes are escaped (double).

  • Reset a numeric variable in As3

    I have a script for a counter I increment button,

    the script is:

    var MyCounter:Number = 0;

    Inside of a button script:

    .. .bla bla...

    MyCounter = MyCounter + 1;

    MyText.text = MyCounter.toString ();

    When I restart 0 MyCounter

    I am trying:

    var MyCounter:Number = 0;

    If MyCounter was 4 he follow with 5 and so on.

    What is the syntax to reset var in as3?

    Thank you.

    You would have to reset the value, just assign a value of zero.

    MyCounter = 0;

    What you write makes it look like you said the same variable again instead.

  • Excel calculations with variables

    Hello world

    What follows is Possible?

    I have this value in three lines in excel 0.007 0.0159 0,1975
    I want the user to enter a number

    How can I do this?

    number * 0.007 + number * 0.1975 + number * 0.0159 so this give me a value... all this in fact Excel so the end result can be stored in the conclusion

    any idea?

    You intend to use the value in the three rows in the form of attributes as well? If not, then could be done:

    1. define the attributes of number two in the Excel workbook or the project (inside a properties file) - I'll call them "value entry" and "exit value".
    2. create a table 2 x 2 decision in Excel, with the first column as the condition and the second column in conclusion.
    3. the first line will be the 'condition' in the style of title condition and the "exit value" text in the style of title of conclusion respectively.
    4 line 2 will be the text "value entry is known" in the style of the State and the text "input value * 0.007 + value * 0.1975 + input value * 0,0159" in the conclusion of style respectively.»

    Decision table will look like this:

    \| condition | output value.
    \| input value is known. input value * value + 0.007 * 0.1975 + input value * 0.0159 |

    This will then compile a rule that deducts the value of output given the input value.

    For more examples of decision in Excel tables, see the topic "Defining decision in Excel workbooks tables" in modeling political Oracle Help (available online at http://www.oracle.com/technetwork/apps-tech/policy-automation/documentation/index.html)

  • fix variable (first emulator)

    I have an equation that I entered the first emulator and want to solve for a variable. I am able to work when I put in values for each variable and leave a vacuum. It solves for the fine missing variable in this case. I want to do is solve the equation for a variable when none of the variables have a value. I expect it would be re - arrange the equation for the variable I scream as it does on my ti89 titanium. Instead I just get a set of brackets in the {} the answer.

    The equation is:

    diffImpedance = 2 * ((80/√relativeEr) * (ln ((1.9*(2*heightSmaller+cuThickness))/(0.8*diffTrace+cuThickness)))*(1-heightSmaller/(4*heightLarger)))*(1-0.374*e^((-2.9*(diffSpace/heightOverall))))

    I put in all the variables as variables user and then store the equation in E0.

    Can I do: solve (E0, diffSpace)

    and the answer I get are the media. I tried it with more basic formulas, and it is the same thing. I'm doing something wrong?

    Thank you

    It must be remembered that A - Z are predefined, numeric variables. This means that if you use them, you pull the value. The first, the symbolic and digital are not mixed together. It's just like if you went through and stored all your variabels from A to Z on the 89 0. It will pull the values to use and you don't have simple variables.

    Press the CASE, type your expression — notice that variable screen where are tiny - and then press ENTER. You get the symbolic solution.

    Solve ((3*x^2) = (5 * y * 4 ^(z-2)), z)

    If you try to make symbolic, exact calculations, then you must use the screen CASE. If you are only numbers and want nothing symbolic, HOME is the place to be.

  • Using variables for the AS2 function arguments

    Hello

    I am trying to create a function in AS2.

    After you create the function, I want to use the values stored in the variables specified for the arguments to the function instead of manually typing static values for the calculation of the service. Also, I want to use the function to assign a new value to the existing variable.

    I asked a similar question here 2 days ago and got the answer (thanks), but now I have another question - how to create the function to assign a value to the variable, the variable itself is also a function argument?

    For example, I have 6 numeric variables:

    var CoinA:Number = 10;
    var CoinB:Number = 20;
    var CoinC:Number;

    var CoinD:Number = 30;
    var CoinE:Number = 40;
    var CoinF:Number;

    Then I tried to create a function to assign values to the variables stuck and CoinF:

    function CalculationA(FirstCoin,_SecondCoin,_ThirdCoin):Void {}

    FirstCoin = SecondCoin + ThirdCoin;

    }

    CalculationA (stuck, CoinA, CoinB);
    CalculationA (CoinF, stuck, CoinF);

    The code above didn't really affect the values of 30 and 70 stuck and CoinF variables, but instead, stuck and CoinF values are undefined.

    Please give me the correct code if there is a good way to do this.

    Thank you

    Here's a way to do it, passing a string value with the name of the variable instead of the actual variable name...

    var CoinA:Number = 10;
    var CoinB:Number = 20;
    var CoinC:Number;
    var CoinD:Number = 30;
    var CoinE:Number = 40;
    var CoinF:Number;

    function CalculationA(FirstCoin,_SecondCoin,_ThirdCoin):Void {}
    This [FirstCoin] = SecondCoin + ThirdCoin;
    }

    CalculationA ('stuck', CoinA, CoinB);
    CalculationA ("CoinF", CoinD, person);

    (Note that in your second function call, I changed coins since CoinF (ThirdCoin) is not defined at this time).

  • Digital loading data from text file for Test of numerical limit

    I am a new user of TestStand 2014.  Just downloaded the demo ran successfully the computer.dll tutorial & example "loading limits a File.seq text"; & is now trying to build my own sequence from scratch.  I want to load a number from a text file using the property Loader.  The file contains the following:

    GGbeg
    484
    GGend

    My hand sequence contains 2 markets (see attachment):

    Charger property (which reads the text file & must store the number 484 in the Step.Result.Numeric variable, right?)

    GG-digital-test (which should test the number 484 in Step.Result.Numeric as a Data Source, right?)

    But when I run it, the measure indicates "0" for the value instead of "484".  What I am doing wrong?  Thank you in advance for your help!

    George

    Hi George,.

    The text file must be in the format, includes no property magazine. Use the following in the text file to make it work:

    GGbeg
    Result.Numeric
    GG-digital-test 484

    Value of the variable

    Value of the variable

    Value of the variable
    GGend

    In the Tools menu of the sequence editor, there are some 'Properties Export/Import' tool, which helps to create text files to be used with charger property stage. I highly recommend to create the new file using the tool and then edit the file to change the values.

    -Shashidhar

  • For a sequence in real-time output variable

    VS 2011, I have a sequence of real-time voltage step that sets an AO for a voltage given for awhile, and then resets the output to 0.

    Just before setting the output to 0, I want to read the response of my this stimulus of an AI System I call StepResponse. To do this, I place this in FinalValue I set as a Variable in my script. In other words, it is a parameter or a local Variable.

    Now, how can I get this out FinalValue? I don't see anything on how to "test" this variable to one of my user variable... I was able to do with the stimulus inherited in VS2010 Editor. Now, I'm stumped.

    Here is the sequence:

    and this is the profile of stimulus and settings below. I can set the fine settings via the API of LV, or run the Publisher of the Stimulus. But I can't seem to get out this FinalValue...

    THX.

    L.

    The return for a sequence (in your case FinalValue) variable is returned to the caller once the sequence has been completed as a result of this sequence. In your example, the appellant is stimulus profile that you configured. In a profile of stimulus, two relevant things will come based on the return value of variable a sequence called:

    1. The return variable value will be get recorded in the file of test result ATML for stimulus profile

    2. You can configure an assessment of output for the call to test sequence make a basic on the return variable test to determine a pass/fail result. For a numeric variable to return such as FinalValue, you can do a check of numerical limits to test whether the value is in or out of the specified limits. For a Boolean return value, you can translate either directly in a pass/fail result, or you can reverse the logic as well as False implies Pass.

    In addition, the LabVIEW API has a function, you can call once the sequence finished to programmatically retrieve the return value.

    However, in your sequence after that you store the value StepResponse in the return variable, you reset to zero before the end of the sequence. If your sequence always returns zero. I think that you do not remove this line and let FinalValue what so that you will get the StepResponse back closure instead of zero value.

  • Use of variable in the instructions of expression TestStand

    I'm trying to implement the following:

    Locals.tot_power = (Locals.reading + Locals.tot_power) 10th

    as long as expression of TestStand, he does not accept the variable locals.reading for power exp. is it possible to do it somehow?

    I guess that there is also another simple solution that is to use the Evaluate() function.
    In the following example, Locals.MyNumber and Locals.Exp are numeric variables.

    E.g.:
    Locals.MyNumber = evaluate (Val ("10F" + Str (Locals.Exp)))

    Roberto Piacentini
    National Instruments
    Technical sales engineer
    www.NI.com/support

  • Get the names of cluster variables

    I have a cluster with a number of numeric variables that are grouped by names. The names and their associated values are now to provide a header of PDM-file via the "TDMS Set Properties" VI. This VI requires the names and values to be separated in the entries of "Property values" and "property names. My question is how to get the names of variables out of the cluster of an array of strings?

    I hope that there will be a nice solution for this but I have not found it.

    The 'Get Array cluster names' suggestion of the community seem to be adsvanced?

    Based on the suggestion of OpenG , here is an excerpt:

    Tone

  • Problem of numerical comparison conditional Action

    I read the long blog of Rod Ward on conditional actions in Captivate, which seems to tell me if I have a user with a numeric variable and I'm comparing it with a literal value of-1 to see if they are equal, it should work fine because, as Rod, says "what is happening under the hood is that strings are first converted to digital before be assessed values.  However, it clearly doesn't.  That's what I have for the IF condition: VariableName is equal to-1.  The value of the variable declared in the Console (via a call to cpAPIInterface.getVariableValue ()) is - 1.  And yet the conditional action performs the ELSE action instead of the action of the YEW, as if he thinks that the variable, the value is - 1 is NOT equal to-1.  Captivate is certainly not lame that it can't handle the sign less on the - 1!  Anyone has an idea why it wouldn't work?

    I was waiting a bit to see if any of the other advanced/prolific contributors would be consistent with an opinion opposite to one Lilybiri expressed, but no one has.  I appreciate the offer of Lilybiri for help .  For awhile, I thought his assertion that Captivate couldn't handle

    If varname is equal to-1

    correctly.  I created a test case very simple to try to confirm, one who had nothing else going on at all to blur the.  I was surprised when it worked very well comparing a variable with-1.  Then I noticed other places in our advancement of existing shares that already rely on it working properly, and they worked as expected.  So I was banging my head against it to try to understand the real reason for a few hours it did not work and then I discovered there are TWO assets, click boxes on this slide, which enabled the AA I had been struggling with and another who had not changed but should be doing the same action as the ELSE the other action.  So basically, I discovered it wasn't a problem with the check against-1, such that it was originally, but execution of the evil AA.

    In addition, if Rod blog comment is correct ("what's happening under the hood is that strings are first converted into digital values before being evaluated"), it SHOULD work perfectly to compare negative numbers.  And it looks good now.

  • Store the user receives the value in a Variable of Odi

    Hello
    I want to store the value user given (run-time) in a .txt file using shell script. If I want to change the value of the user given to the shell script. In the package, I put the variable in mode refresh as a first step, then the odioscommand link OK. When I try to run this package fails (* ODI-1246: * the logical schema has not been set for Input_Variable).

    FYI: -.
    I just create a simple numeric variable. Select the most RECENT VALUE for her and the schema is not defined. Default value is 0.
    After that this problem occurred I select the oracle, memory engine diagram diagram etc and run again the package/scenario but it the same result.

    Please advice
    Thank you
    Papai

    NB
    Here are the details of the problem: -.

    ODI-1246: the logical schema has not been defined for Input_Variable.
    at com.sunopsis.dwg.dbobj.SnpSessTask.getDefaultDwgConnectConnection(SnpSessTask.java:508)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.getExecutor(SnpSessTaskSqlV.java:428)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.processTask(SnpSessTaskSqlV.java:405)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTask(SnpSessTaskSqlV.java:240)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)
    at java.lang.Thread.run(Thread.java:662)

    Yes. If you want to pass the variable at run time, then you will see a pop-up window. Here, you can pass the value.

  • Variables added to the URLS in the headers

    What is the purpose of numeric variables added to links of files CSS in the header HTML Muse are used?

    Muse Variable in CSS.JPG

    The purpose of these query strings described here - http://forums.adobe.com/thread/996154.

    Thank you

    Vinayak

Maybe you are looking for