How to make two fields agree whether whole number or number with ".00" decimal is used - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to make two fields agree whether whole number or number with ".00" decimal is used

Last post 03-22-2018 12:59 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-21-2018 03:15 PM

    How to make two fields agree whether whole number or number with ".00" decimal is used

    Hello! I have an infopath form which is producing an error message on two fields which need to agree. One field is called InvoiceAmount, which the user needs to manually enter, and it is set as formatted currency, USD with 2 decimal places. Users can enter the whole number with or without decimals if there are no cents in the amount (ie 20 or 20.00). There is a second amount called SplitTotal which needs to agree with the Invoice Amount field. Essentially, the SplitTotal field is adding/summing several lines that the user can use to split the total mount of 20. The split amount must match the Invoice amount, but what is happening is the SplitTotal field is automatically placing the ".00" in the amount if the totals come to a whole number. So if the user entered the whole number and no decimals in the InvoiceAmount, the two fields are not matching. I have to anticipate that users will do this very (innocent) thing and encounter the same error. Is there a way to make the two fields agree if the amount entered is a whole amount, whether they just enter the whole number or the whole number with the two zeros after the decimal? Thank you for your help! Jen
  • 03-22-2018 08:07 AM In reply to

    Re: How to make two fields agree whether whole number or number with ".00" decimal is used

    Is SplitTotal also a decimal? I'm assuming you have the data type on both of these fields set to decimal? Here's a sample form that uses the number function to compare a decimal to a text field, in case that's helpful (but I'd recommend setting the data type to SplitTotal to decimal). Save the attached file locally, right click & select design to open in design mode, then you can preview and try it out.
    Hilary Stoupa

  • 03-22-2018 11:53 AM In reply to

    Re: How to make two fields agree whether whole number or number with ".00" decimal is used

    Good Morning Hilary! Both fields are configured exactly the same. Both are Data Type Decimal (double), formatted as Currency symbol $ English (United States), with the decimal set at 2 places, using a digit grouping symbol (,). The Split Total field is adding up 12 lines of split amounts and they are also formatted the very same. This is why I do not understand why this is happening. None of these fields contain text - they are all set as specified above. Any ideas? Thanks again for your help! Jen
  • 03-22-2018 12:59 PM In reply to

    Re: How to make two fields agree whether whole number or number with ".00" decimal is used

    Put calculated values on the form that show the actual values (not formatted) so you can compare them. The formatting may be confusing the issue.
    Hilary Stoupa

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