drop down list contains decimal data types retreived from SharePoint List - too many decimal places - InfoPath Dev
in

InfoPath Dev

drop down list contains decimal data types retreived from SharePoint List - too many decimal places

Last post 10-31-2011 10:45 AM by Doreen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-28-2011 02:56 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    drop down list contains decimal data types retreived from SharePoint List - too many decimal places

    I have a form (IP 2007) that retrieves currency values from a SharePoint 2007 list.  The columns in SharePoint are set as currency data type with 2 decimal places.  I am using a drop down control to retrieve the currency value but the number displays14 decimal places and I only want 2.  How do I control the decimal places in a drop down list?  There is no function in a drop down control so that I can control this.  Should and can I do this through C# code behind?  If so how?

  • 10-28-2011 04:10 PM In reply to

    Re: drop down list contains decimal data types retreived from SharePoint List - too many decimal places

    One way to change a value in every row of a repeating group is to identify some field that you're not going to use, and after you query the data source, have a rule that sets that field to some improbable value, like 9898989898989.  Then put any rules you want on that field to change the values of other fields in that repeating group.  In this case you would add a rule to set your currency field to round(currencyField * 100) div 100.  That will update the values in each row accordingly.

    Makes sense?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-31-2011 10:45 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: drop down list contains decimal data types retreived from SharePoint List - too many decimal places

    Thanks for the feedback. I tryed this but it's not working.  I am probably setting it up wrong.  It had the effect of temporarily displaying a no decimal place number but it displayed the new value in addtion to the existing list, not in place of it and then it when away when another selection is made...

    FYI when a selection is made from currencyField (the dropdown control), it's value is auto-filled in another field and other fields are also auto-filled.  The auto-filled fields display properly with the desired two decimal places.  currencyField reads from SharePoint list that also display it's values with only 2 decimal places in the list. 

    Per your advice I added a rule to currencyField control to set another field called extraField, to 99999.99999. 

    Action: set field extraField to 99999.99999

    on extraField control, I added a rule as follows:

    Condition: if currencyField is not blank,

    Action: set field extraField to round(currencyField * 100) /100

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.