ColdFusion number and date format mask

coldfusion functions masks

FunctionsMasks.cfm


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>coldfusion functions masks - how to use masks in coldfusion functions</title>
</head>

<body>
<h2 style="color:DarkBlue; font-style:italic">coldfusion functions masks example: how to use</h2>
<hr width="450" align="left" color="LightBlue" />
<br />

<cfset Salary=1525>
<cfset SalaryWithMask=NumberFormat(Salary,"$")>
<cfset ToDay=DateFormat(Now())>
<cfset ToDayWithMask=DateFormat(Now(),"mmmm-dd-yyyy")>

<table border="0" cellpadding="2" cellspacing="2" bgcolor="DeepPink" width="250">
 <tr style="background-color:OrangeRed; color:Snow; font-size:large;">
     <td>Variable=Value</td>
     <td>Output</td>
    </tr>
 <cfoutput>
        <tr style="background-color:HotPink; color:Snow; font-family:'Courier New', Courier, monospace">
            <td>Salary=1525</td>
            <td>#Salary#</td>
        </tr>
        <tr style="background-color:HotPink; color:Snow; font-family:'Courier New', Courier, monospace">
            <td>SalaryWithMask=NumberFormat(Salary,"$")</td>
            <td>#SalaryWithMask#</td>
        </tr>
        <tr style="background-color:HotPink; color:Snow; font-family:'Courier New', Courier, monospace">
            <td>ToDay=DateFormat(Now())</td>
            <td>#ToDay#</td>
        </tr>
        <tr style="background-color:HotPink; color:Snow; font-family:'Courier New', Courier, monospace">
            <td>ToDayWithMask=DateFormat(Now(),"mmmm-dd-yyyy")</td>
            <td>#ToDayWithMask#</td>
        </tr>
    </cfoutput>
</table>

</body>
</html>







More ColdFusion tutorials