Asp: retain two decimal places: asp retains two decimal places

Source: Internet
Author: User

Asp: retain two decimal places: asp retains two decimal places

 

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

FormatNumber(Expression[,NumDigAfterDec[, IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
Parameters Description
Expression Required. The expression to be formatted.
NumDigAfterDec The number of digits to the right of the decimal point. The default value is-1 (the computer's region settings are used ).
IncLeadingDig Optional. Determines whether to display the leading zero (leading zero) of a small value ):
  • -2 = TristateUseDefault-use the settings in computer region settings.
  • -1 = TristateTrue-True
  • 0 = TristateFalse-False
UseParForNegNum Optional. Indicates whether to place a negative value in parentheses.
  • -2 = TristateUseDefault-use the settings in computer region settings.
  • -1 = TristateTrue-True
  • 0 = TristateFalse-False
GroupDig Optional. Indicates whether to use the numeric grouping symbol specified in the computer region settings to group numbers.
  • -2 = TristateUseDefault-use the settings in computer region settings.
  • -1 = TristateTrue-True
  • 0 = TristateFalse-False

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.