Avoid Hexadecimal Values in Floating Point Calculations in infopath - InfoPath Dev
in

InfoPath Dev

Avoid Hexadecimal Values in Floating Point Calculations in infopath

Last post 11-09-2015 05:22 AM by Reema Daga. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-30-2015 01:28 AM

    Avoid Hexadecimal Values in Floating Point Calculations in infopath

    i am getting 'NaN' error at the infopath footer field which is performing addition to all rows' values. 1. it is repeating table with all fields off Decimal(double) type. total 13 fields. from January to December and last total field... 2. for horizontal addition, i am using rules as well as default value formula to the total field(i.e fx= (jan+feb+mar and so on))... 3. for vertical addition, i am using default value formula(i.e fx= sum(jan))... ---------------------------------------------------- things i tried 1. using round function in formulas and rules(e.g round(field1 *100)* 0.01)... 2. try to change datatype of values coming from db(from float to decimal)... 3. try to remove number formatting... 4. check "refresh value when formula is recalculated"... 5. make textbox's postback "Always"... ------------------------------------------------------ findings: 1. when i see "1" in horizontal total field, actually it is "0.999999999970896" in xml 2. when i try to substract 1 from that "1"(actually from "0.999999999970896" ) i get "0" in horizontal total field and "NaN" in its Vertical field. but when i see the xml value of that resulting "0", i see some hexadecimal value behind there in xml. i think NaN word is coming because i get hexadecimal value in horizontal total field. thats why sum(total) function not works there and i get NaN at bottom. how to avoid hexadecimal value result in floating point calculations in infopath???
    Filed under: , ,
  • 11-02-2015 06:21 AM In reply to

    Re: Avoid Hexadecimal Values in Floating Point Calculations in infopath

     Hi Sanjay,

     Thank you for your post on infopathdev. Is it possible for you to send me your form? 

     Thanks,

     Reema 

    Reema Daga
    Qdabra® Software / InfoPathDev.com / FormsQuo / 425 999 4597 direct

    Business Process Automation for Everyone – Streamline data gathering to turn process into knowledge.™

     

  • 11-09-2015 03:27 AM In reply to

    Re: Avoid Hexadecimal Values in Floating Point Calculations in infopath

    Hello. the issue is solved now. i used formula [fx= round((jan+feb+mar+apr+may+june+july+aug+sep+oct+now+dec)*100)*0.01] on both default value of total column and also on rules of every individual month column Note: if you make this change only at one place(either on default value or on rules), that will not work
  • 11-09-2015 05:22 AM In reply to

    Re: Avoid Hexadecimal Values in Floating Point Calculations in infopath

    Great! Thank you for sharing the solution.

    Reema Daga
    Qdabra® Software / InfoPathDev.com / FormsQuo / 425 999 4597 direct

    Business Process Automation for Everyone – Streamline data gathering to turn process into knowledge.™

     

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