I have a list with a field that contains an integer, let´s say 12345. In the edit/view form, the field is displayed as 12,345. How can I format the field so that it displays 12345? This is how the field looks in sharepoint designer.

<SharePoint:FieldLabel Grid.Column="0" Grid.Row="0" ControlMode="Display" FieldName="EmployeeNumber" />
<Comment FieldName="EmployeeNumber" FieldInternalName="EmployeeNumber" FieldType="Integer"    />
<SharePoint:FormField Grid.Column="1" Grid.Row="0" ControlMode="Display"  FieldName="EmployeeNumber" IncludeDescription="True"/>

Out of the box, I am afraid there is no option to remove the comma. I have seen similar issues with dates, where a year would be rendered as 2,012 instead of 2012 for example.

Unless you have specific requirements, the easiest workaround is to use a text column instead of a number column.

  • If I change FormField to TextField, I get an error: Unable to cast object of type 'Microsoft.SharePoint.SPFieldNumber' to type 'Microsoft.SharePoint.SPFieldText'. – AGuyCalledGerald Nov 2 '12 at 17:13
  • What I meant was to change the column type from number to text, in the list settings (not in SharePoint Designer). I have edited my answer. – Christophe Nov 2 '12 at 17:24

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.