Numbers

JWT is a number specialist!

Numbers can be provided as fixed values - or literals - in the format described in the table below or they can be retrieved by using field codes.

Fixed values

Numbers can be added to any expression as fixed values.

Input

Example

Valid numerical values

  • 1

  • 3.141592

  • .5

  • -400

  • -1.1 

  • -.02

Variable values (field values)

Numeric values of  number  data type fields can be inserted in any expression as number field codes using the following notation {...somenumberfield} - e.g {issue.votes}.

The most common use cases for calculating with numbers are in fact related to dates and times, since these timestamps are internally represented as numbers.

Mathematical functions

JWT is very powerful when it comes to numbers and calculations. It offers a wide range of mathematical functions to be used in a parser expression.

Besides the functions listed below, JWT offers the common arithmetical operators:

  • Number1 +  Number2 : adding two nunbers

  • Number1  -  Number2 : subtracting Numberfrom Number1

  • Number1  *  Number2 : multiplying two numbers

  • Number1  /  Number2 : dividing Numberby Number2

Available functions

Function Short description Output
abs()

Returns the absolute value of the input number.

number

acos()

Returns the arccosine value of the input number.

number

asin()

Returns the arcsine value of the input number.

number

atan()

Returns the arctangent value of the input number.

number

cbrt()

Returns the cube root of the input number.

number

ceil()

Returns the next higher integer.

number

cos()

Returns the cosine of the given number.

number

cosh()

Returns the hyperbolic cosine of the input number.

number

floor()

Returns the the next lower integer.

number

log()

Returns the natural logarithm of the input number.

number

log10()

Returns the base 10 logarithm of the input number.

number

max()

Returns the larger of two numeric values.

number

min()

Returns the smaller of two numeric values.

number

modulus()

Returns the remainder after division of the dividend by the divisor.

number

pow()

Returns the exponentiation of two numbers.

number

random()

Returns a number between 0 and 1.0.

number

remainder()

Returns dividend - divisor * n, where n is the closest integer to dividend/divisor.

number

round()

Returns the closest integer to the input number.

number

sin()

Returns the trigonometric sine of angle number expressed in radians.

number

sinh()

Returns the hyperbolic sine of the input number.

number

sqrt()

Returns the square root of the input number.

number

tan()

Returns the trigonometric tangent of angle number expressed in radians.

number

tanh()

Returns the hyperbolic tangent of the input number.

number

toDegree()

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

number

toRadians()

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

number