DATA Step, Macro, Functions and more

How to convert decimal value to exponential in SAS

Accepted Solution Solved
Reply
Contributor
Posts: 43
Accepted Solution

How to convert decimal value to exponential in SAS

hI,

 

My pvalue has value like : 0.000082634.

But I need to convert it into 8.26E-5. Could anyone please let me know how to do this?

 

Thanks,

Megha


Accepted Solutions
Solution
‎09-29-2015 03:32 PM
Valued Guide
Posts: 765

Re: How to convert decimal value to exponential in SAS

Posted in reply to maggi2410

Hi.  If you are asking how to display that value in scientific notation, use a format ...

 

data _null_;

x = 0.000082634;
put x e9.;
run;

 

If you are really asking how to convert numeric a numeric value, it's an odd question since SAS stores all numeric values in the same manner (unless you start playing with numeric value lengths).  It's just  the display of the value that you can alter.

View solution in original post


All Replies
Solution
‎09-29-2015 03:32 PM
Valued Guide
Posts: 765

Re: How to convert decimal value to exponential in SAS

Posted in reply to maggi2410

Hi.  If you are asking how to display that value in scientific notation, use a format ...

 

data _null_;

x = 0.000082634;
put x e9.;
run;

 

If you are really asking how to convert numeric a numeric value, it's an odd question since SAS stores all numeric values in the same manner (unless you start playing with numeric value lengths).  It's just  the display of the value that you can alter.

Contributor
Posts: 43

Re: How to convert decimal value to exponential in SAS

Thank you MikeZdeb. Yes I meant display. Your solution worked. Many thanks
Super User
Posts: 19,768

Re: How to convert decimal value to exponential in SAS

Posted in reply to maggi2410
Please mark the question as Answered Smiley Happy
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 286 views
  • 2 likes
  • 3 in conversation