function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PaulMacPaulMac 

Adding a simple format to a <apex: outputfield/>

Hi,

 

Can I add some kind of formatting tag to this to remove the leading zeros:

<apex:outputField value="{!cx.CaseNumber}"/>

 

the above yields: 00004788, but I would like just 4788

 

I'm using the above line in a VisualForce email template.

 

thank you!

Pradeep_NavatarPradeep_Navatar

Use VALUE Function to remove leading zeros : <apex:outputField value="{!VALUE(cx.CaseNumber)}"/>        

 

Did this answer your question? if so, please mark it solved.

PaulMacPaulMac

Thank you for your reply, but it's not quite working. When I try to save the email template I get:

Error missing ")"

 

It's very strange since that line looks perfectly fine.

<apex:outputField value="{!VALUE(cx.CaseNumber)}"/>

 

I remove this bit of code and the template saves fine. Also, I couldn't find documentation for the function VALUE.

 

thanks,

Paul