How to convert decimal value to exponential in SAS

Reply
New User
Posts: 1

How to convert decimal value to exponential in SAS

I'm having an issue formatting a percentage to decimal. The code is currently set to format 5.4. For 1.00% and 100.00% it converts both to .0100. Is there a workaround for this?

Super User
Super User
Posts: 6,315

Re: How to convert decimal value to exponential in SAS

Can you post example data? 1% is 0.01 and 100% is 1.

A format of 5.4 would not leave any room to display values to the left of the decimal place.  So a value or 1 (or 100%) would only be able to show 3 decimal places ('1.000' ).

If your numbers are changing their decimal place on you then perhaps you are mistakenly usng an INFORMAT of 5.4.  The decimal part of an INFORMAT is not normally used. It means where to insert a decimal point WHEN NO DECIMAL POINT is present.  So if you read '1' using F5.4 it would convert that to 0.0001 .

Grand Advisor
Posts: 10,196

Re: How to convert decimal value to exponential in SAS

To add to Tom's response, if you are reading data an the value is a percentage you might look at using the Percent informat.

 

You might post the code and some data that is showing this behavior.

Ask a Question
Discussion stats
  • 2 replies
  • 173 views
  • 0 likes
  • 3 in conversation