ASP Functional Library (3)

Source: Internet
Author: User
Tags date expression numeric locale numeric value
function

FormatCurrency ()


FUNCTION: Returns an expression that has been formatted as a currency value


syntax:formatcurrency (Expression [, Digit] [, Leadingdigit] [, Paren] [,


Groupdigit]]]


Arguments:digit indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the
is used

the locale of the computer; Leadingdigit a three-state constant indicating whether to display the
in front of the decimal point

0.


EXAMPLE: <%=formatcurrency (34.3456)%>


Result: $34.35


 


FormatDateTime ()


FUNCTION: Returns an expression that has been formatted as a date or time


Syntax:formatdatetime (Date, [, NamedFormat])


Arguments:namedformat Indicates the value of the date/time format used, and if omitted, uses the


vbgeneraldate.


EXAMPLE: <%=formatdatetime ("08/4/99", vblongdate)%>


Result:wednesday, August 04, 1999


 


FormatNumber ()


FUNCTION: Returns an expression that has been formatted as a numeric value.


Syntax:formatnumber (Expression [, Digit] [, Leadingdigit] [, Paren] [,


Groupdigit]]]


Arguments:digit indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the
is used

the computer's locale.; Leadingdigit I indicates the number of digits displayed to the right of the decimal point. The default value is-


1, which indicates that the computer's locale is being used.; Paren indicates the number of digits displayed to the right of the decimal point. Default

The
value is-1, indicating that the computer's locale is being used.; Groupdigit I indicates the display of digits to the right of the decimal point

The value of the
. The default value is-1, which indicates that the computer's locale is being used ...


EXAMPLE: <%=formatnumber (45.324567, 3)%>


result:45.325


 


formatpercent ()


FUNCTION: Returns an expression that has been formatted as a percentage of the trailing% symbol (multiplied by


100). (%)


Syntax:formatpercent (Expression [, Digit] [, Leadingdigit] [, Paren] [,


Groupdigit]]]


ARGUMENTS: Ditto.


EXAMPLE: <%=formatpercent (0.45267, 3)%>


result:45.267%


 


Hour ()


FUNCTION: Returns the number of hours at 24 o'clock.


Syntax:hour (Time)


ARGUMENTS:


EXAMPLE: <%=hour (#4:45:34 pm#)%>


result:16


(Hour has been converted to 24-hour system)

   Instr ()
   FUNCTION: Returns the position in which a character or string appears for the first time in another string.
   Syntax:instr ([Start,] strtobesearched, strsearchfor [, compare])
   ARGUMENTS: Start is the starting value for the search, strtobesearched the string that accepts the search
  strsearchfor the character to search for. Compare comparison mode (see ASP constants in detail)
   EXAMPLE: <%
  strtext = "This is a test!!" 
  pos = Instr (StrText, "a")
  response.write pos
  %>
   Result:9
  
  instrrev ()
   FUNCTION: Ibid., just from the last search of the string
   yntax:instrrev ([Start,] strtobesearched, strsearchfor [, compare])
   ARGUMENTS: Ibid.
   EXAMPLE: <%
  strtext = "This is a test!!"
  pos = InStrRev (StrText, "s")
  response.write pos
  %>
    result:13
  
  
  int ()
   FUNCTION: Returns a numeric type, not rounded, noteThe value is an integer that is not greater than it.
   syntax:int (number)
   ARGUMENTS:
   EXAMPLE: <%=int (32.89)%> <% =int ( -3.33)%>
   result:32-4
  
  isarray ()
   FUNCTION: Sentencing Returns a Boolean value if the object is an array.
   Syntax:isarray (name)
   ARGUMENTS:
   EXAMPLE: <%
   Strtest = "test!"
  response.write IsArray (strtest)
  %>
   result:false







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.