The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Borland/Segue SilkTest

Pages: 1
TheQAGuy
Newbie


Reged: 07/10/10
Posts: 11
Converting string from scientific notation to real
      #691830 - 11/22/11 03:36 PM

How do I convert a string in scientific notation to real without rounding it. e.g, I want to convert 1.79185E-05 to 0.0000179185. Using Val("1.79185E-05") converts it to 0.00002 and I am not looking for a rounded number, I want the exact number in real, any ideas?

Post Extras: Print Post   Remind Me!   Notify Moderator  
rakeshraghvani12345
Junior Member


Reged: 01/21/05
Posts: 336
Loc: UK
Re: Converting string from scientific notation to real [Re: TheQAGuy]
      #691857 - 11/23/11 02:19 AM

For example,

Code:
[-] testcase TestIT() appstate none
[ ] STRING str1 = "1.79185E-05"
[ ] Printf("%2.10f", Val(str1))



Post Extras: Print Post   Remind Me!   Notify Moderator  
TheQAGuy
Newbie


Reged: 07/10/10
Posts: 11
Re: Converting string from scientific notation to real [Re: rakeshraghvani12345]
      #691896 - 11/23/11 06:58 AM

Thanks Rakesh for the info, you saved me some time, I was going to create a custom function to convert scientific notation to real. The above function is the answer to my problem, for anyone else interested if you use PrintftoString you will get the value in a string.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 9 anonymous users are browsing this forum.

Moderator:  AJ, jamesso, DJGray, David Reed 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1115

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5