asp: Keep Two decimal places:

Source: Internet
Author: User

<%=formatnumber ( -6665.8999,3,-1,-1,0)%>
(6665.900)
An example uses all the parameters of the function FormatNumber ():
The first parameter (-6665.8999) specifies the number to be formatted.
The second parameter (3) specifies the number of digits to display after the decimal point.
The third parameter (-1) specifies whether the leading 0 is displayed.
The fourth parameter (-1) Specifies whether parentheses are used for negative numbers.
The last parameter (0) specifies whether to display separators

FormatNumber (expression[,numdigafterdec[, Incleadingdig[,useparfornegnum[,groupdig]])
Parameters Description
Expression Required. An expression that needs to be formatted.
Numdigafterdec A numeric value indicating the number of digits to the right of the decimal point. The default value is-1 (using the computer's regional settings).
Incleadingdig Optional. Indicates whether to display the leading 0 of the decimal value (leading zero):
  • -2 = tristateusedefault-Use the settings in the computer's regional settings.
  • -1 = Tristatetrue-true
  • 0 = Tristatefalse-false
Useparfornegnum Optional. Indicates whether negative values are placed in parentheses.
  • -2 = tristateusedefault-Use the settings in the computer's regional settings.
  • -1 = Tristatetrue-true
  • 0 = Tristatefalse-false
Groupdig Optional. Indicates whether numbers are grouped using the number grouping symbols specified in the computer's regional settings.
  • -2 = tristateusedefault-Use the settings in the computer's regional settings.
  • -1 = Tristatetrue-true
  • 0 = Tristatefalse-false

asp: Keep Two decimal places:

Related Article

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.