DATA Step, Macro, Functions and more

Multiply fraction with a number

Reply
Contributor
Posts: 73

Multiply fraction with a number

Hi,

I have a dataset with time variable and the time is in minutes. I want the fraction of a minute to multiply with 60 to get seconds. Can anybody help me with this.

 

e.g. These are the minutes, 1.98 minutes and I want the output as 1:59 seconds

 

Response  output

1.98           1:59

4.75           4:45

5.68           5:41

6.93           6:56

7.45           7:27

5.96           5:57

3.67           3:40

 

 

thank you

M

Contributor
Posts: 34

Re: Multiply fraction with a number

Posted in reply to Malathi13

I think the trick is converting the time to seconds first and then using a time format.  So 1.98 minutes would be 60*1.98=118.8 seconds or rounded to 119 seconds

Respected Advisor
Posts: 2,833

Re: Multiply fraction with a number

Posted in reply to stuart_snap

And then apply the MMSS. format to make it appear as 1:59

--
Paige Miller
Ask a Question
Discussion stats
  • 2 replies
  • 87 views
  • 0 likes
  • 3 in conversation