To apply formats for Dates or Times other than the current date and time, use [format]
Format is used for text and numbers. Format will also apply formatting to dates and times provided they are converted to numbers first. To convert a date or time into a number, enclose them with curly braces, and wrap them in a [math] context. This will convert dates into number of days since 00/00/0000, and times into number of seconds since midnight. And then they can be wrapped in a format context for custom formatting.[math]{08/14/2008}[/math] --> 733633
[math]{10:12:07}[/math] --> 36727
1. [Format Days_To_Date %m/%d/%y][math]{08/14/2008}[/math][/format]
2. [format Days_To_Date %A, %B %d, %Y][math]{08/14/2008}[/math][/Format]
3. [format Days_To_Date %A, %B %d, %Y]733633[/format]
4. [format Days_To_Date]733633[/Format]
5. [format Seconds_To_Time %I:%M:%S %p][math]{10:12:07}[/math][/format]
6. [format Seconds_To_Time %I:%M:%S %p]36727[/format]
[math][format days_to_date %d][math]{[date]}[/math][/format][/math]
[grep search= 0&replace= ]
[format Days_To_Date %A, %B %d, %Y][math]{[date]}[/math][/format]
[/grep]
Numeric formatting works with comma separators for decimal point (non-US style, such as [format 6,2f][math]39/7[/math][/format] yields 7,46 instead of 7.46)
[format 10.2f]99.5[/Format] (f stands for floating-point number)
[format 10s]Hello[/format] (s stands for string of text)
[format Days_To_Date %m/%d/%y]195462[/format]
[format Seconds_To_Time]49768[/format]
[format Seconds_To_Time %I:%M:%S %p]49768[/format]
[format thousands 14.2f]394363210[/format]
[format thousands 14,2f]394363210[/format]
[format thousands .3d]7[/Format] (d stands for decimal number)
| 99.50| (10 wide, 2 after the decimal)
|Hello | (10 wide, text)
|04/07/1997| (#days as a date)
|13:49:28|
|01:49:28 PM|
|394,363,201.00| (14 wide, number with thousands separator)
|394.363.201,00| (14 wide, number with European thousands separator)
|007| (3 wide, integer part of number only, zeroes preceding)
8.3f = | 345.670| (f stands for floating point)
8.2f = | 345.67|
8.1f = | 345.7| (notice rounding from .67 to .7)
8.0f = | 346| (notice rounding from .67 to next higher integer)
.5d = |00345| (notice no rounding, and preceding 0s to fill 5 digits)
It is always advised to [format] your math operations as WebDNA is working on a deep fractional part of the number, rounded by the server processor, which can sometimes yield strange results: instead of getting a "0", you might obtain a 0.0000000000000001
To specify the precision of a number, we must use like [format .2f][math]25*34.567[/math][/format]. From version 8.6, you can use [math .2f]25*34.567[/math]
DOWNLOAD WEBDNA NOW!
A list of all WebDNA instructions...
F.A.QA compilation of some user's questions...
Tips and TricksA list of user-submitted tips ...
WebDNA ModulesA list of the currently available modules...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
Create an empty folder on your webspace...
[formvariables]Lists all the form variables and parameters passed to the current page...
[capitalize]Capitalizes the first letter of all words in a sentence...
[ddeconnect]...
[deletefolder]Deletes a folder from your website...
[movefolder]Move a folder and all its contenton your webspace...