14

Is there a way to achieve this without adding a calculated item with this format = TEXT([Customer Number], "0") ??

I'm using sharepoint 2013.

  • Have you tried sp designer for changing xslt dataview ?. have a look this link and link – Flying Hope Jul 7 '15 at 7:09
  • Warning: Many of the ways to get rid of the thousands separator will convert the value to text (calculated field will do this, too). Be aware, that this will change sorting to alphabetically instead of numerical! – Hinek Sep 27 '17 at 13:31
9

There are couple of approaches to achieve this:

  1. Using Client Side Rendering

    • Using CSR you can manipulate how your column data is visualized. But you'll need to manually put the JSLink everywhere.
  2. Use Text Column and do validation

    • You can use a text column instead of number and do a below column validation:

      =ISNUMBER([ColumnName]+0)
      
| improve this answer | |
4

I added a JSON for the column formatting of the number column. Try the code below:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "attributes": {
    "class": "=if(@currentField > 0,'', '')"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "display": "inline-block"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}
| improve this answer | |
  • Welcome to the SharePoint StackExchange. User is using SharePoint 2013 and Column formatting is not supported in SharePoint 2013. – Ganesh Sanap Sep 24 '19 at 11:07
  • 1
    Thank you. I am unaware of such restriction. – panicdb Oct 8 '19 at 10:11
2

Or use a workflow to write a Number value to another Text field.

Or do not use a Number field and make [Customer Number] a Text field.

formatting can be an issue still

| improve this answer | |
1

with jQuery (or simple javascript selectors) remove them

var numberinput=$("inputid")
numberinput.val(numberinput.val().replace(/,/g,""))
| improve this answer | |
  • Would this be placed on the list page? If so, would it look like this: <script src="ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script> <script> var numberinput=$("COLUMN DISPLAY NAME") numberinput.val(numberinput.val().replace(/,/g,"")) </script> – Caleb Fortner Oct 14 '16 at 21:49
  • select all column's cells by a selector like $('table tr td:nth-child(3)') and then look for text() or innerHtml and then replace it with clean value. – Iman Oct 15 '16 at 10:00
1

I've just got same problem with commas in a number field. I checked MS Docs and found this: NumberFormatInfo.NumberGroupSeparator Property The initial value of this property is derived from the settings in the Region and Language item in Control Panel.

I've changed EN region to German(Austria) and now there are no commas for me.

Not the best solution, but it makes sense.

| improve this answer | |

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.