NaN error when adding up two double values - InfoPath Dev
in

InfoPath Dev

NaN error when adding up two double values

Last post 04-12-2010 03:11 AM by gerwinee. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-31-2010 02:58 AM

    NaN error when adding up two double values

    I use InfoPath 2007. 

    I tried to do the following.
    Select a check box and the following rule will be applied: total = total + articlePrice
    When i uncheck the check box the following rule will be applied: total = total - articlePrice

    It works fine, until articlePrice has decimals in it (12,50) and i want to save or close the field, then i get a NaN error or i get the message than only numbers are allowed.

    I've tried the following sollution, but with no luck. http://blogs.msdn.com/infopath/archive/2008/04/17/invalid-data-error-when-calculating-the-result-of-2-or-more-fields.aspx

    total and articlePrice are both TextBox with data type Decimal (double)
    total has a default value of 0.

  • 03-31-2010 03:18 AM In reply to

    Re: NaN error when adding up two double values

     Might you be able to attach a stripped-down version of your form that can reproduce this issue?  I can't seem to get it to happen on my end.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-31-2010 04:19 AM In reply to

    Re: NaN error when adding up two double values

    The problem only appears when i use it in a webbrowser.

  • 03-31-2010 05:40 AM In reply to

    Re: NaN error when adding up two double values

    NaN is an error code returned by Javascript (hence why it only appears in a browser).  It stands for Not A Number.  I'd check the values of the numbers your adding up, and ensure that they have numbers in them (and are not null).

    if one of the variables is as you posted "12,50", then that's a problem because of the comma -- which is then interpreted to be text string.

  • 04-01-2010 06:12 AM In reply to

    Re: NaN error when adding up two double values

    How can i use 12,50 then? Because 12.50 isn't allowed either.

  • 04-02-2010 04:04 AM In reply to

    Re: NaN error when adding up two double values

    hmmmm....  i can't reproduce it either.  have you tried deleting the textboxes and starting over?  Try that, but start with only one rule.  If that works, then add the other.  Start small and build your way up.

    Sorry I don't have more for ya, but I can't get it to fail on my end.

  • 04-12-2010 03:11 AM In reply to

    Re: NaN error when adding up two double values

    Did anybody tried to deploy the sample I included in my previous post and did that work without problems?

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