# Visual FoxPro functions for numbers

FoxPro is a database program not a specialist package for mathematics or statistical analysis but it does provide most of the basic mathematical tools. If Visual FoxPro does not support the function you want, consider using Automation to call Excel.

Here is a list of some of the more useful commands and functions. Many of them accept extra optional parameters. Look in the FoxPro Help system for more information about their use and syntax.

Note that FoxPro syntax requires that functions are always followed by a pair of brackets - even if there's nothing in them.

 % return the remainder after dividing by ** return to the power ^^ return to the power ABS() return the absolute value of . ACOS() return the arc cosine of as radians. Also ASIN(), ATAN() and ATN2(). CALCULATE TO () Perform calculations on a field from a table and store the result in a variable named . more CEILING() return the integer equal or greater than . COS() return the cosine of radians. Also SIN() and TAN(). COUNT TO () store the number of records in a table and store the result in a variable named . more DTOR() return the equivalent of radians in degrees. EXP() return e number. FLOOR() return the integer equal or less than . INT() return the integer part of . LOG() return the logarithm of to the base e. LOG10() return the logarithm of to the base 10. MAX(, , , ...) return the maximum value from the list. MIN(, , , ...) return the minimum value from the list. MOD(, ) return the remainder after dividing by . RAND() returns a random number between 0 and 1 using as the seed for the random number generator. ROUND(,) return rounded to decimal places. RTOD() return the equivalent of degrees in radians. SIGN() return -1, 0 or +1 if is negative, zero or positive. SET DECIMAL TO() display numbers with decimal places. SET FIXED ON|OFF determine whether to display all numeric results with a fixed number of decimal places. STR(,,) return as a string variable of characters rounded to decimal places. SUM TO () Calculate the sum of a field from a table and store the result in a variable named (). more VAL() returns the numeric value of .  