The Trip Maintenance application now provides a useful drill-down mechanism for locating trips. Although this application is functionally sound, its appearance could be improved, including formatting dates and dollar amounts, and making long lists easier to read.
ColdFusion provides several functions to improve application appearance. These include the DateFormat and DollarFormat functions that format dates and currency variables.
| Existing code | Replacement code |
|---|---|
#departureDate# |
#DateFormat(departureDate, "mm/dd/yyyy")# |
#returnDate# |
#DateFormat(returnDate, "mm/dd/yyyy")# |
#price# |
#DollarFormat(price)# |
#baseCost# |
#DollarFormat(baseCost)# |
departureDate, returnDate, and price indicated in the table.
The Trip Search Results page appears:
The properly formatted Trip Detail page appears:
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting
Version 7
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000145.htm