0

I am trying to format the field BodyLength of the Attachment Object which is an Integer in my VisualForce Page. This should work but it doesn't.

<apex:outputText value="{0, number, ###,###,###,###}">
    <apex:param value="{!att.BodyLength} kb"/>
</apex:outputText>

I got the following error message:

The value attribute on is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

Any idea how to format an integer as a number or any other solution? Thank you in advance for your help. Sylvie

2

Instead of providing the unit at the param, provide it at the outputText and it should work.

<apex:outputText value="{0, number, ###,###,###,### kb}">
    <apex:param value="{!myint}"/>
</apex:outputText>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.