Activity Forums Salesforce® Discussions How To Display The Formatted Number / Date In Visual Force? Which Component Should Be Used?

  • How To Display The Formatted Number / Date In Visual Force? Which Component Should Be Used?

    Posted by Aman on September 20, 2018 at 2:54 pm

    How To Display The Formatted Number / Date In Visual Force? Which Component Should Be Used?

    Parul replied 6 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • shariq

    Member
    September 20, 2018 at 2:56 pm

    Hi,

    Use component “<apex:outputText>”.

    Example : Format the number into currency.

    <apex:outputtext value="{0, number, 000,000.00}">

    <apex:param value="{!valFromController}" />

    </apex:outputtext>

    OR

    <apex:outputtext value="{0, number, ###,###.00}">

    <apex:param value="{!valFromController}" />

    </apex:outputtext>

    Thanks

  • Parul

    Member
    September 20, 2018 at 4:30 pm

    Adding code snippet

    <apex:page controller="DmVFcheck_CC" >
    <apex:form>

    <apex:inputField value="{!evento.StartDateTime}" >
    <apex:actionSupport event="onchange" action="{!functionName}" reRender="renderOp1"/>
    </apex:inputField>
    <apex:outputPanel id="renderOp1">

    <apex:outputText value="{0, date,dd MMMM yyyy}">

    <apex:param value="{!evenDate}" />
    </apex:outputText>

    </apex:outputPanel>

    </apex:form>
    </apex:page>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos