Round Function

neetu
neetu Community Member Posts: 5
In your title, set up a new HTML object, and set Object Type to Header Scripting.Enter the following code:

Code:

function PercentRound(obj) {var a = obj.getValue();a = Math.round(a);return a;}


Then set up a new action:On: ShowAction: Modify VariableTarget: RoundedNumberValue: javascript:PercentRound(VarOriginalNumber)Modification Type: Set Variable ContentsThis assumes that you have a number set up as a variable called OriginalNumber. You'll need to repeat this action with new variables for however many rounded numbers you have on the page. Name the variables OriginalNumber1, RoundedNumber1, OriginalNumber2, RoundedNumber2, etc.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!