Monday, February 17, 2014

SharePoint Number Column without Commas

Problem: SharePoint Number columns shows , (comma) in View/Display Forms. There are specific numeric columns, User wanted to display without commas.

There is no direct way to remove comma/avoid thousand separator in SharePoint Number fields, But the below tricks help to get SharePoint 2007/2010/2013 number column values without commas.

Here are some solutions to show number fields without comma:

  1. Use "Single Line of Text" instead of "Number" column type, if possible. (But this will not stop users from entering alpha characters!)
  2. Use an another Calculated column with formula: = TEXT( Number_Column_Name, "0") . If you need sorting, you can use: =FIXED(Number_Column_Name,0,TRUE) 
  3. Add Integer field programmatically (As there is no interface to do this!)
    #Get all site collections of the provided web application
    $Web = Get-SPWeb ""
    $ListName = "ProjectBudget"
    $list = $web.lists[$ListName]
    $list.Fields.Add("TotalValue", [Microsoft.SharePoint.SPFieldType]::Integer, $false)
  4. If its for a view, You can use Dataview/XSLT web part with "format-number" formula as: <xsl:value-of select='format-number(TotalValue,"#.00") '/>
 sharepoint 2010 format number column without comma

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...