![]() |
Question about converting exponential values in DT - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Question about converting exponential values in DT (/Thread-Question-about-converting-exponential-values-in-DT) |
Question about converting exponential values in DT - cowboy49 - 02-16-2012 Hello, I am trying to set a value that is represented by exponent 2^63. QTP always displays 9.22337203685478E+18. I want to display the actual number 9223372036854775808. Is there any way to do this? Will I have to create a function for this? If so, how can this be accomplished? Thank you. RE: Question about converting exponential values in DT - inborntester - 02-16-2012 Code: a=Replace(FormatNumber(2^63,0,0,0),",","") RE: Question about converting exponential values in DT - cowboy49 - 02-16-2012 Thanks inborntester. But the number returned is rounded up the last digit (9223372036854780000). I need the exact number 9223372036854775808. RE: Question about converting exponential values in DT - inborntester - 02-17-2012 think, its native format conversion of VB compiler not able to optimise. Better you can develope you own Power function if its need is high. Logically it can ge possible with few for looks and array objects. RE: Question about converting exponential values in DT - Ankur - 02-17-2012 Values in VBScript are accurate to 15 digits only. This should set you in the right direction (taken from http://www.windows-api.com/microsoft/VBScript/35530350/adding-a-long-integer-question.aspx ) Code: Wscript.Echo AddInts(148991, 76561197960265728) RE: Question about converting exponential values in DT - cowboy49 - 03-12-2012 Thank you very much Ankur this worked for me!! |