How to get the currency symbol in Visualforce page?

Use <apex:outputField/> to show the currency symbol, instead of using <apex:outputText/>.
Sample Code:

Visualforce page:

<apex:page controller="Sample">
    <apex:pageblock >
        <apex:pageBlockTable value="{!OpptyList}" var="O">
            <apex:column value="{!O.Name}"/>
            <apex:column >
                <apex:outputField value="{!O.Amount}"/>

Apex Controller:

public class Sample {  
    public List<Opportunity> OpptyList {get;set;}
    public Sample() {
        OpptyList = [SELECT Name, Amount FROM Opportunity];


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit