SQL-like query language for csv

Numeric Functions

name description
CEIL Round a number up
FLOOR Round a number down
ROUND Round a number
ABS Return the absolute value of a number
ACOS Return the arc cosine of a number
ASIN Return the arc sine of a number
ATAN Return the arc tangent of a number
ATAN2 Return the arc tangent of two numbers
COS Return the cosine of a number
SIN Return the sine of a number
TAN Return the tangent of a number
EXP Return the value of base e raised to the power of a number
EXP2 Return the value of base 2 raised to the power of a number
EXPM1 Return the value of base e rised to the power of a number minus 1
LOG Return the natural logarithm of a number
LOG10 Return the decimal logarithm of a number
LOG2 Return the binary logarithm of a number
LOG1P Return the natural logarithm of 1 plus a number
SQRT Return the square root of a number
POW Returns the value of a number raised to the power of another number
BIN_TO_DEC Convert a string representing a binary number to an integer
OCT_TO_DEC Convert a string representing a octal number to an integer
HEX_TO_DEC Convert a string representing a hexadecimal number to an integer
ENOTATION_TO_DEC Convert a string representing a number with exponential notation to an integer or a float
BIN Convert an integer to a string representing the bynary number
OCT Convert an integer to a string representing the octal number
HEX Convert an integer to a string representing the hexadecimal number
ENOTATION Convert a float to a string representing the number with exponential notation
NUMBER_FORMAT Convert a number to a string representing the number with separators
RAND Return a pseudo-random number

e is the base of natural logarithms

Definitions

CEIL

CEIL(number)
number
float or integer
return
float or integer

Rounds number up to an integer value.

CEIL(number, place)
number
float or integer
place
integer
return
float or integer

Rounds number up to place decimal place. If place is a negative number, place represents the place in the integer part.

FLOOR

FLOOR(number)
number
float or integer
return
float or integer

Rounds number down to an integer value.

FLOOR(number, place)
number
float or integer
place
integer
return
float or integer

Rounds number down to place decimal place. If place is a negative number, place represents the place in the integer part.

ROUND

ROUND(number)
number
float or integer
return
float or integer

Rounds number to an integer value.

ROUND(number, place)
number
float or integer
place
integer
return
float or integer

Rounds number to place decimal place. If place is a negative number, place represents the place in the integer part.

ABS

ABS(number)
number
float or integer
return
float or integer

Returns the absolute value of number

ACOS

ACOS(number)
number
float or integer
return
float or integer

Returns the arc cosine of number.

ASIN

ASIN(number)
number
float or integer
return
float or integer

Returns the arc sine of number.

ATAN

ATAN(number)
number
float or integer
return
float or integer

Returns the arc tangent of number.

ATAN2

ATAN2(number2, number1)
number2
float or integer
number1
float or integer
return
float or integer

Returns the arc tangent of number2 / number1, using the signs of the two to determine the quadrant of the returns value.

COS

COS(number)
number
float or integer
return
float or integer

Returns the cosine of number.

SIN

SIN(number)
number
float or integer
return
float or integer

Returns the sine of number.

TAN

TAN(number)
number
float or integer
return
float or integer

Returns the tangent of number.

EXP

EXP(number)
number
float or integer
return
float or integer

Returns the value of base e raised to the power of number.

EXP2

EXP2(number)
number
float or integer
return
float or integer

Returns the value of base 2 raised to the power of number.

EXPM1

EXPM1(number)
number
float or integer
return
float or integer

Returns the value of base e rised to the power of number minus 1.

LOG

LOG(number)
number
float or integer
return
float or integer

Returns the natural logarithm of number.

LOG10

LOG10(number)
number
float or integer
return
float or integer

Returns the decimal logarithm of number.

LOG2

LOG2(number)
number
float or integer
return
float or integer

Returns the binary logarithm of number.

LOG1P

LOG1P(number)
number
float or integer
return
float or integer

Returns the natural logarithm of 1 plus number.

SQRT

SQRT(number)
number
float or integer
return
float or integer

Returns the square root of number.

POW

POW(base, exponent)
base
float or integer
exponent
float or integer
return
float or integer

Returns the value of base raised to the power of exponent.

BIN_TO_DEC

BIN_TO_DEC(bin)
bin
string
return
integer

Converts bin representing a binary number to an integer.

OCT_TO_DEC

OCT_TO_DEC(oct)
oct
string
return
integer

Converts hex representing a octal number to an integer.

HEX_TO_DEC

HEX_TO_DEC(hex)
hex
string
return
integer

Converts hex representing a hexadecimal number to an integer.

ENOTATION_TO_DEC

ENOTATION_TO_DEC(enotation)
enotation
string
return
integer or float

Converts enotation representing a number with exponential notation to an integer or a float.

BIN

BIN(integer)
integer
integer
return
string

Converts integer to a string representing the binary number.

OCT

OCT(integer)
integer
integer
return
string

Converts integer to a string representing the octal number.

HEX

HEX(integer)
integer
integer
return
string

Converts integer to a string representing the hexadecimal number.

ENOTATION

ENOTATION(float)
float
float
return
string

Converts float to a string representing the number with exponential notation.

NUMBER_FORMAT

NUMBER_FORMAT(number [, precision, decimalPoint, thousandsSeparator, decimalSeparator])
number
float or integer
precision
integer

The default is -1. -1 is the special precision to determine the number of digits automatically.

decimalPoint
string

The default is “.”.

thousandsSeparator
string

The default is “,”.

decimalSeparator
string

The default is empty string.

return
string

Converts number to a string representing the number with separators.

RAND

RAND()
return
float

Returns a random float greater than or equal to 0.0 and less than 1.0.

RAND(min, max)
min
integer
max
integer
return
integer

Returns a random integer between min and max.