How can I round up and round down to the nearest 100 from a stored value?

Rounding to nearest 100:

executeScript_Sandbox | return 100 * Math.ceil(${raw}/ 100); | result

See also generate random number

Macro:

    {
      "Name": "rounding",
      "CreationDate": "2021-10-13",
      "Commands": [
        {
          "Command": "store",
          "Target": "61234",
          "Value": "raw",
          "Description": ""
        },
        {
          "Command": "executeScript_Sandbox",
          "Target": "return 100 * Math.ceil(${raw}/ 100);",
          "Value": "rounded",
          "Description": ""
        },
        {
          "Command": "echo",
          "Target": "${rounded}",
          "Value": "green",
          "Description": ""
        }
      ]
    }
2 Likes