Working With Numeric Data in Recital
From Recital Documentation Wiki
Revision as of 14:37, 22 January 2010 by Yvonnemilne (Talk | contribs)
Contents
Working With Numeric Data in Recital
Certain set commands change the display format of numeric data:
- set decimals - specify the number of decimal places to be displayed
set decimals to <places as numeric>
- set fixed - determine whether the number of decimal places displayed is fixed
set fixed on | off
- set point - specify the character to be used as the decimal point
set point to [<point as character>]
- set separator - specify the character to be used to mark thousands
set separator to [<separator as character>]
Numeric Conversion Functions
- abs() - return the absolute value of a numeric
numeric = abs(number as numeric)
- cast() - perform data type conversion
expression = cast(expression as expression AS datatype as character [, width as numeric [, precision as numeric]] [null | not null])
- chr() - perform numeric to ASCII character conversion
character = chr(number as numeric)
- ctrl() - return the numeric value of a control character
numeric = ctrl(letter as character)
- currency() - perform numeric to currency string conversion
character = currency(number as numeric)
- etos() - perform expression to string conversion
character = etos(expression as expression)
- int() - return the integer value of a numeric
numeric = int(number as numeric)
- str() - perform numeric to string conversion
character = str(number as numeric [, width as numeric [, decimals as numeric [, base as numeric]]] )
- strzero() - perform numeric to zero left-padded string conversion
character = strzero(number as numeric [, width as numeric [, decimals as numeric]])
- transform() - perform expression to string conversion based on a picture formatting clause
character = transform(expression as expression, picture as character)
- val() - perform string to numeric conversion
numeric = val(string as character)
Miscellaneous Numeric Functions
- acos() - calculate the angle size in radians of a cosine
numeric = acos(cosine as numeric)
- asin() - calculate the angle size of any given sine value
numeric = asin(sine as numeric)
- atan() - calulate the angle size of a given tangent value
numeric = atan(tangent as numeric)
- atn2() - calculate the angle size for the specified cosine and sine values of a given point
numeric = atn2(cosine as numeric, sine as numeric)
- between() - determine whether an expression is between two other specified expressions
- celing() - calculate the smallest integer that is greater than or equal to a given value
- cos() - calculate the cosine of an angle in radians
numeric = cos(radians as numeric)
- dtor() - perform degree to radian conversion
numeric = dtor(degrees as numeric)
- exp() - calculate exponential value
- floor() - calculate the largest integer that is less than or equal to a given number
- lennum() - calculate the length of a numeric value
- log() - calculate natural logarithm value
- log10() - calculate base 10 logarithm value
- max() - calculate the greater of two values
- min() - calculate the lesser of two values
- mod() - calculate the division remainder
- percent() - calculate percentage
- pi() - return the value of pi
- rand() - return a random number
- round() - return a rounded numeric
numeric = round(number as numeric)
- rtod() - perform radian to degree conversion
numeric = rtod(radians as numeric)
- sign() - return the sign of a numeric value
numeric = sign(number as numeric)
- sin() - calculate the sine of an angle in radians
numeric = sin(radians as numeric)
- sqrt() - calculate a square root
numeric = sqrt(number as numeric)
- tan() - calculate the tangent of an angle in radians
numeric = tan(radians as numeric)