Salesforce Apex: Data Formatting in Visualforce using outputText

Below are a few handy methods to format data in Visualforce without writing the formatting logic in Apex class. You can use it for Number, Date, Time or Choice.

Formatting Date


Formatting Number/Currency


Formatting Choice


If Project.Budget__c = 0, “This project has no budget.”
If 1 < Project.Budget__c < 1000, “This project has some budget.”
If Project.Budget__c > 1000, “This project has #### budget.” #### is equals to Project.Budget__c

Get in touch today to see how WDCi can help your business.