



(4 ratings)
Dates:
|
There are a lot of ways to display dates. The first line returns the short date in a 25/06/2008 format while the second line returns the long date in a 25 June 2008 format.
Times:
|
There are a lot of ways to display dates. The first line returns the short date in a 14:48 format while the second line returns the long date in a 14:48:00 format. If you want the display to update and continue counting seconds live on the users browser, you need to use JavaScript to do this.
Currency:
<% Response.Write FormatCurrency ( Variable, -1, -2, -2, -2) %> |
When displaying currency, these are the system default settings. The first setting Variable is the variable containing the amount. The second setting is the number of decimal places. The third setting specifies not to use leading zeros for numbers less than one. The fourth setting specifies not to use parenthesis around negative numbers. The fifth setting specifies not to use a comma to separate number larger than one thousand. As you can see, the third, fourth, and fifth settings are in the "off" position by default. To turn these settings "on", replace their respective -2 setting with a -1. To specify the number of decimals to use, simply change the second setting from -1 to whatever number you want.
Numbers:
<% Cint (Variable) %> |
When displaying numbers, Cint displays the Integer subtype which takes up 2 bytes in memory and can contain a value between -32,768 and 32,767.
<% Clng (Variable) %> |
When displaying numbers, Clng displays the Long subtype which takes up 4 bytes in memory and can contain a value between -2,147,483,648 and 2,147,483,647.
<% Cdbl (Variable) %> |
When displaying numbers, Cdbl displays the Double subtype which takes up 8 bytes in memory, 4 bytes of which are used for contatining fractional values. It is a very precise subtype used for advanced mathematical expressions including fractional or decimal values.
These are just a few of the most common techniques for formatting special data. We will continue to add more formatting techniques to this page as time goes on so be sure to check back here for new additions.
Happy Formatting
20 Random Tutorials from the same category :
Processing Form Information In ASP
Installing ASP on your own computer
ASP.NET 2 Special Purpose Folders
SQL Access Methods In ASP
ASP.NET Tutorial - Making image thumbnails
AIM Profile Screenname Viewer as a component of AIM Profile Designs
Counting Visitors In ASP
Displaying Server Values In ASP
Reading a Database
Text Editors and Software to Write ASP
Iterating through Collections In ASP
Passing Query Strings In Asp
Using Application Variables
Counter in ASP
DISPLAY DATA FROM DATABASE
Server-side Scripting
Recordset Access Methods
Creating Databases
String Functions
Randomizer for ASP














