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

1 Answer 1

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>
1
  • +1 was trying to remember this Aug 28, 2019 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .