Docs
/
numbers

Numbers

This file contains functions that are related to numbers.

sum

Link Copied!

Calculates the sum of an array of numbers.

sum([1, 2, 3, 4, 5])
15
Result
sum(numbers: number[])

mean

Link Copied!

Calculates the mean of an array of numbers.

mean([1, 2, 3, 4, 5])
3
Result
mean(numbers: number[])

average

Link Copied!

Calculates the mean of an array of numbers.

average([1, 2, 3, 4, 5])
3
Result
average(numbers: number[])

margin

Link Copied!

Calculates the margin based on a percentage.

margin(1234, 33)
407.22
Result
margin(value: number, percentage: number)

addMargin

Link Copied!

Adds the margin to the value.

addMargin(1234, 33)
1641.22
Result
addMargin(value: number, percentage: number)

subtractMargin

Link Copied!

Subtracts the margin from the value.

subtractMargin(1234, 33)
826.78
Result
subtractMargin(value: number, percentage: number)

addMarkup

Link Copied!

Adds the markup to the value.

subtractMargin(1234, 33)
1641.22
Result
addMarkup(value: number, percentage: number)

subtractMarkup

Link Copied!

Calculates the markup based on a percentage.

subtractMarkup(1234, 33)
927.82
Result
subtractMarkup(value: number, percentage: number)

median

Link Copied!

Calculates the median of an array of numbers.

median(1,2,3,4,5)
3
Result
median(numbers: number[])

mode

Link Copied!

Calculates the mode of an array of numbers.

mode(1,2,3,4,5)
Result
mode(numbers: number[])

min

Link Copied!

Finds the minimum value in an array of numbers.

min(JSON.parse(value))
1
Result
min(numbers: number[])

max

Link Copied!

Finds the maximum value in an array of numbers.

max(1,2,3,4,5)
5
Result
max(numbers: number[])

minMax

Link Copied!

Returns the minimum and maximum values in an array of numbers.

minMax(1,2,3,4,5)
[ 1, 5 ]
Result
minMax(numbers: number[])

range

Link Copied!

Returns the difference between two values, expressed as a positive number.

range([1, 2, 3, 4, 5])
4
Result
range(numbers: number[])

standardDeviation

Link Copied!

Returns the standard deviation of an array of numbers.

standardDeviation([1, 2, 3, 4, 5])
1.4142135623730951
Result
standardDeviation(numbers: number[], options?: { method: 'sample' | 'population' })

skewness

Link Copied!

Returns the measure of asymmetry of the probability distribution of an array of numbers. The skewness value can be positive, zero, negative, or undefined.

skewness([1, 4, 30])
3.0557739000180533
Result
skewness(numbers: number[])