Salesforce Apex: Data Formatting in Visualforce using outputText
September 25, 2012 /
Posted in Salesforce Corner, Tips and Tricks
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