CCUR Function ---------------------------------------------------------------------------- Action Converts a numeric expression to a currency value. Syntax CCUR( numeric-expression) Remarks The argument numeric-expression can be any numeric expression. See Also CDBL, CINT, CLNG, CSNG Example The following example passes a double-precision, floating-point value to a FUNCTION procedure that returns the sales tax, as a currency value, for the passed value. The returned value has four digits of precision, but it is displayed in conventional currency value format with two places to the right of the decimal. CCUR is used to convert from double-precision to currency data type. DECLARE FUNCTION GetSalesTax@ (Amount#, percent!) ' $INCLUDE. 'FORMAT.BI' CONST percent! = 8.1 CLS ' Clear screen. INPUT "What is the taxable currency amount"; Amount# PRINT USCurFmt$ = FormatC$(GetSalesTax@(Amount#, percent!), "$#,###,###,##0.00") SetFormatCC (49) ' West Germany WGCurFmt$ = FormatC$(GetSalesTax@(Amount#, percent!), "#.###.###.##0,00") WGCurFmt$ = WGCurFmt$ + " DM" PRINT "In the United States, currency is displayed with commas as" PRINT "numerical separators and a period serves to separate whole from" PRINT "fractional currency amounts. In some European countries, the" PRINT "numerical separator is a period, and the comma serves to separate" PRINT "whole from fractional currency amounts." PRINT PRINT "In the US, the tax on $"; Amount#; "at"; percent!; "percent is " PRINT "displayed as "; USCurFmt$ PRINT PRINT "In West Germany, the tax on"; Amount#; "DM at"; percent!; "percent" PRINT "is displayed as "; WGCurFmt$ END FUNCTION GetSalesTax@ (Amount#, percent!) GetSalesTax@ = CCUR(Amount# * (percent! * .01)) END FUNCTION