NaN after rounding - InfoPath Dev
in

InfoPath Dev

NaN after rounding

Last post 03-21-2012 07:52 AM by eliasen. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-21-2012 07:52 AM

    • eliasen
    • Top 500 Contributor
      Male
    • Joined on 10-07-2010
    • Aalborg, Denmark
    • Posts 33

    NaN after rounding

    Hi all

    Using InfoPath 2007 on Forms Server 2007.

    I have a data source field which is a double. I have a textbox, in which users can enter a value, and I have a rule that basically does this: ". = round(. * 10) div 10" - so basically, I multiply the value by 10, round it and divide by ten, så I am sure I only have one digit after the decimalpoint. The rounded number is used for calculations later on, so I cannot just use the display properties of the textbox to only show one decimal.

    Now, what happens is that the rule seems to work just fine; If I enter "27,17" it will change quickly to "27,2" and I am happy. Trouble is that after the next post back I seem to have an NaN instead. In my example I have a button with a rule on it with an action that switches view. After the view has been switched, the "27,2" has completely disappeared and a "NaN" appears instead.

    I am not sure where the error happens.But it is rather annoying. I expect it has to do with Culture somehow - the fact that Danes use comma as a decimal separator as opposed to the English notation of using the period. I do need the Danish notation, though.

    Does anyone have any thoughts on this?

    Thanks

    eliasen, representing himself and not the company he works for.
    Microsoft BizTalk MVP
    Blog: http://blogs.eliasen.dk/technical/
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.