Workaround: Format SharePoint number column to remove commas

Let’s say you have a column named “TicketNumber” of number type in your list. By default SharePoint formats it to show with commas. If your requirement is not to show those comma’s then here is a workaround.

Create another column of  ‘Calculated’ column type and set the formula as follows:

=TEXT(Original_Number_Column_Name,”0″)

Ex: =TEXT([TicketNumber],”0″)

And then use the calculated column in place of your original column for display purposes.

16 thoughts on “Workaround: Format SharePoint number column to remove commas

  1. Pingback: [SharePoint 2007] Remove Commas From Number Column Workaround « SharePoint John

  2. I get a syntax error. Am I supposed to replace Original_Number_Column_Name with something specific, like a number and a column name?

    • Ok, (duh) my numeric column is Year, so I changed the formula to:

      =TEXT([Year],”0″)

      but I still get this when I hit OK:

      “The formula contains a syntax error or is not supported.”

      I’m using SharePoint 2007.

  3. This seems like a pointless workaround. I have a list of building numbers that I’d like to be able to sort as if they were a number (1,2,10, etc.) instead of as a text field (1, 10, 2, etc.) but I don’t want a comma in it. This effectively converts the number column into a text field causing it to be sorted as such (even if I choose number as the type of calculated field). This seems pointless because you can just make the type of column a text field anyway. If there is a way to preserve the sorting and remove the commas that’d be very useful.

    • Steven – I faced the same issue – but able to figure out using SharePoint designer – Find my steps below:

      1. I did the above work around to remove commas from a number column
      2. Opened the sharepoint list page in SharePoint Designer and converted the list into XSLT Data View
      3. Click the column which you want to sort in designer (split mode) which will directly take you to the xsl code delaration of column properties as shown below, Minutes is the column which I enabled with above workaround and enabled sorting by changing the fieldtype from x:string to x:int.

      @Minutes Minutes
      Minutes
      1
      x:int

      This works for me.

      • Steven – I faced the same issue – but able to figure out using SharePoint designer – Find my steps below:

        1. I did the above work around to remove commas from a number column
        2. Opened the sharepoint list page in SharePoint Designer and converted the list into XSLT Data View
        3. Click the column which you want to sort in designer (split mode) which will directly take you to the xsl code delaration of column properties as shown below, Minutes is the column which I enabled with above workaround and enabled sorting by changing the fieldtype from x:string to x:int.

        xsl:with-param name=”fieldname” @Minutes /xsl:with-param
        xsl:with-param name=”fieldtitle” Minutes /xsl:with-param
        xsl:with-param name=”displayname” Minutes /xsl:with-param
        xsl:with-param name=”sortable” 1 /xsl:with-param
        xsl:with-param name=”fieldtype” x:int /xsl:with-param

        This works for me.

  4. If the field is blank, the calculated column will show “0” with the above solution. For the calculated column to also be blank, use
    =TEXT(Original_Number_Column_Name,”#″)

  5. Use the following formula in a calculated field:

    =FIXED([],0,TRUE)

    This will keep the field as a numeric value without commas and will sort in number order.

  6. Use the following formula in a calculated field:

    =FIXED([Your_Number_Field_Here],0,TRUE)

    This will keep the field as a numeric value without commas and will sort in number order.

    • I cannot seem to get this to work. I have a field (ProjectCode) that pulls data from an external source. It is a text field. So, I create a calculated column setting ProjectCode to a datatype of Number (ProjectNumeric). It now sorts great, but the comma appears. I then try another calculated column =FIXED([ProjectNumeric],0,TRUE). Great that the commas are gone, but the sorting is not correct. On this second calculated column I tried setting the data type returned as both single line of text and number…neither works. Any suggestions? Thank you!

  7. Pingback: [SharePoint 2007] Remove Commas From Number Column Workaround | John Chapman

Leave a reply to [SharePoint 2007] Remove Commas From Number Column Workaround | John Chapman Cancel reply