sharepoint "numbers" come in as "decimal" - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

sharepoint "numbers" come in as "decimal"

Last post 04-08-2015 01:20 PM by Gracie. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-27-2008 01:33 PM

    sharepoint "numbers" come in as "decimal"

     I have columns setup in sharepoint as a type "number".  I set the "number of decimal places" to be 0. 

     However, when the column value is brought into Infopath, it comes in as a decimal number with several decimal percision 0's.  ex  10  comes into sharepoint as 10.00000000.

     This creates a compatibility issue with the access database the value is set to be stored to it as an integer. It also creates an issue when comparing that number to an "ID" field that does not come in with the percision.

     

    Example

    Table 1

    Table1
    ID = Number  
    title = text

     

    Table 2
    ID = Number
    table1_id = Number (number of decimal points = 0)
    title = text
    value = Number  (where value = 1500)
     

     
    Infopath reads in the "Id's" as integers.  However, it reads in table1_id as  a decimal number.

     

    Thus, when doing a cascading list,   Table1.ID != table1_id ever.    because  1 !=1.000000

    Value shows up in infopath as 1500.000000000  but I want it to be 1500

    Can something be done in sharepoint or infopath to make it come into infopath as a true integer?
     

     


     

  • 02-27-2008 03:31 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    You can change the format of the fields in SharePoint to text.

    Or you can use the num function or a substring to remove the extra decimals in InfoPath.

    You can also format text fields as to how many decimal places to show, etc.

  • 01-02-2009 07:26 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    I have the same issue.  When I try to format the SharePoint numbers column as text, however, it reorders everything so that all the numbers beginning with '1' appear before all of the numbers beginning with '2', etc.... (for example, 1, 10, 100, 101, 102, 2, 20, 200, 201, 202, etc...)

  • 01-02-2009 07:54 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: sharepoint "numbers" come in as "decimal"

    Hello Welcome to the Forums,

    You have to do setting in InfoPath, we have formatting option for decimal field in InfoPath. We have to set decimal places value 0 then first we will get the values from database with decimal after reaching the InfoPath form it will get update with our formatting.

  • 01-02-2009 08:32 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    Thanks for the welcome.


    When I try to change the properties of the drop-down box which is pulling the numbers from SharePoint, I have several options under 'Data type:' - Text (string), Whole Number (integer) Decimal (double), and several others which I'm certain won't help.

    It would seem that 'Whole Number' is the logical choice, but if I choose that, I still get a bunch of zeros after the decimal place.  When I pick 'Decimal (double)', I have the same problem. 

    This seems like a simple fix, yet I can't figure it out.  Frustrating! :)

     

  • 01-02-2009 10:08 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: sharepoint "numbers" come in as "decimal"

    Hello,

    We have round and floor function in InfoPath to get only integer part for those fields. You can add the rule to set the same value using round function then you will get only integer part for that field.

  • 01-03-2009 12:01 AM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    Hi,
     I think there may be some setting in the sharepoint. One workaround is add a whole (integer) type field to the schema. And set the default value of that field is substring-after(dropdownfield,"."). So that you will get the value which is there in the SharePoint. When you compare the values use this value instead of drop down value.

     

    Swathip
    www.ggktech.com
  • 01-03-2009 12:39 AM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    Hi,
    Use substring-before function instead of substring-after.

     

    Swathip
    www.ggktech.com
  • 01-03-2009 09:32 AM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    Ok, I got excited for a second because both of those worked. 

    However, the other rules I have built on that dropdown box no longer worked.  For instance, I have several rules that set the values of other fields based on the selection made in this dropdown box that I'm struggling with.  Using either the 'round' or 'floor' function returns only the integer (dropdown box still displays all of the zeros when the dropdown is activated, but switches to an integer once a value is selected), but infopath can't seem to resolve that integer with the other rules.

    Still stumped....

  • 03-22-2010 09:58 AM In reply to

    • khaos
    • Not Ranked
    • Joined on 03-11-2010
    • Posts 3

    Re: sharepoint "numbers" come in as "decimal"

    Neil, Did you ever find a solve for this?

  • 09-06-2010 12:21 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

     

     Hi,

         Did somebody find a solve for this?... Is there a variant... ? ...

  • 02-23-2011 05:25 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    following worked for me 

    1. Set the field as a decimal

    2. In the decimal format set the decimal places to Auto.

    3. Set the number of character limits to 3

     

     

  • 02-28-2011 01:37 PM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    Hi, Acaspita - are you running into an issue? If so, let us know what your scenario is. I'm not able to replicate bharvey's original problem from 2008, using InfoPath 2010 and SharePoint 2010. I set my data type to Decimal and decimal places to 0. I may be misunderstanding Sema's suggestion, but setting a character limit of 3 does limit the user from entering a four-digit number ("1,500"), which may not work in your case. Thanks

    Jennifer Walts
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-01-2011 08:54 AM In reply to

    Re: sharepoint "numbers" come in as "decimal"

    you don't need to set the limit to decimal. just setting the decimal places to auto does the work.

  • 11-21-2013 10:18 PM In reply to

    • Kanji
    • Not Ranked
    • Joined on 08-22-2013
    • Posts 6

    Re: sharepoint "numbers" come in as "decimal"

    Or you can try it number() it works for me in inforpath 2013.
Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.