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.