FormatCurrency ()

Source: Internet
Author: User
Tags constant expression numeric value
FormatCurrency Function
Returns a expression formatted as a currency value using the currency symbol defined in the System Control Panel.

FormatCurrency (Expression[,numdigitsafterdecimal][,includeleadingdigit][,useparensfornegativenumbers] [, GroupDigits]]])

Arguments
Expression

Required. Expression to be formatted.

Numdigitsafterdecimal

Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value Is-1, which indicates that computer ' s regional settings are used.

IncludeLeadingDigit

Optional. TriState constant that indicates whether or not a leading the zero is displayed for fractional values. The Settings section for values.

UseParensForNegativeNumbers

Optional. TriState constant that indicates whether or not to place negative values within parentheses. The Settings section for values.

GroupDigits

Optional. TriState constant that indicates whether or not numbers are grouped using the group delimiter specified in the computer ' s Regional Settings. The Settings section for values.

Settings
The IncludeLeadingDigit, useparensfornegativenumbers, and groupdigits arguments have the following settings:

Constant Value Description
TristateTrue-1 True
Tristatefalse 0 False
TristateUseDefault-2 use the setting from the computer ' regional settings.


Remarks
When one or more optional arguments are omitted, values for omitted arguments-are provided by the computer ' s regional Ings. The position of the currency symbol relative to the currency value are determined by the system ' s regional settings.

Note All settings information comes to Regional Settings Currency tab, except leading zero, which comes from the N Umber tab.

The following example uses the FormatCurrency function to format the expression as a currency and assign it to mycurrency:

Dim mycurrency
Mycurrency = formatcurrency (1000) ' mycurrency contains $1000.00.
Requirements



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.