Prevent the Number field from auto-inserting commas - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Prevent the Number field from auto-inserting commas

Last post 01-22-2020 11:01 AM by Roberto A.. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-08-2013 11:47 AM

    • AlexK
    • Top 150 Contributor
    • Joined on 12-31-2012
    • Posts 61

    Prevent the Number field from auto-inserting commas

    For an InfoPath browser form submitting to a SharePoint 2010 form library, how can I stop the auto-formatting of a Number field from inserting commas into numbers >= 1000? For example, if a field was for an ID or a credit card number, commas would not be appropriate.
    Filed under:
  • 02-09-2013 05:17 PM In reply to

    Re: Prevent the Number field from auto-inserting commas

    Hi AlexK,

    The data representation of the number field will not contain commas. That's just formatting for display. Please make sure the data type is Whole Number or Decimal. Those will support comma formatting, but the data format will be what you expect. To verify, you can save your form as XML, open in Notepad (or similar) and search for the field name.

    Best of luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 02-11-2013 09:35 AM In reply to

    • AlexK
    • Top 150 Contributor
    • Joined on 12-31-2012
    • Posts 61

    Re: Prevent the Number field from auto-inserting commas

    My data type is set to Whole Number already and I do not want the display to show commas. I'm not really worried about how it is represented underneath, I just don't want to see the commas on the form.

  • 02-11-2013 09:51 AM In reply to

    • AlexK
    • Top 150 Contributor
    • Joined on 12-31-2012
    • Posts 61

    Re: Prevent the Number field from auto-inserting commas

    I was able to figure out how to do it, even though there seems to be no documentation on this feature throughout the world wide internets. Anyway, here are the steps:

    1. Right-click the number box (not from the Fields section, but on the form itself) and select "Text Box Properties"

    2. Under the Data tab, find "Data Type" and set it to "Whole Number (integer)"

    3. To the right of that, click the "Format..." button: This is the key part!

    4. Now you can see at the bottom an option for "use a digit grouping symbol". Right there is how to remove the auto-commas, but initially it is grayed out.

    5. Under Format, select the "Number" radio button option. The check box for the grouping symbol is now enabled. Un-check this, click OK.

    6. ???

    7. Profit!

  • 02-11-2013 10:12 AM In reply to

    Re: Prevent the Number field from auto-inserting commas

    You'll also find the format button available for decimals, dates, datetime, and time datatypes.

    Hilary Stoupa

  • 10-24-2014 07:57 AM In reply to

    Re: Prevent the Number field from auto-inserting commas

    Just came across this thread. This is the first InfoPath form I am creating where there is a SharePoint list column that has more than three digits. So I ran in the comma problem for a year. 2014 - 2,014. The data type in InfoPath is greyed out. I assume this is because the form is tied to a SharePoint list where the column is just defiined as a number. I created a new field in the form and when I looked under data type there was no whole number listed. This is InfoPath and SharePoint 2010 by the way.

    Microsoft certainly does some odd things with both products (I have a long list of issues that I have found), but there is absolutely no way to get rid of the comma without making it a text field/converting the value to text? I was hoping in the year-plus that this post was written that someone came up with a better solution.

     

    Thanks,

    Drew

  • 01-22-2020 11:01 AM In reply to

    • Roberto A.
    • Not Ranked
      Male
    • Joined on 01-22-2020
    • West Palm Beach, FL
    • Posts 1

    Re: Prevent the Number field from auto-inserting commas

    These steps worked perfect - thank you!
    Roberto A.
    Filed under: ,
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.