cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal to Time

Former Member
0 Kudos

Hi,

Can somebody help in converting Decimal to time?

e.g. : 8.5 = 8:30

Many thanks,

Dharmi

Accepted Solutions (1)

Accepted Solutions (1)

former_member203343
Contributor
0 Kudos

Hi Dharmi,

It's a little bit complicated but here it is:

=REPLACE(NSTR(FLOOR(@NUM1),".0"),".","")&":"&REPLACE(NSTR(((@NUM1-FLOOR(@NUM1))*60),".0"),".","")

Regards,

Natty

Former Member
0 Kudos

Hi Netanel,

Thank you for the quick response. It works well with decimal digits but suppose if the number is 10, it displays 10:0, instead of 10:001

Regards,

Dharmi

former_member203343
Contributor
0 Kudos

Why do you expect it to display 10:001? if the number is 10. I would expect it to display 10:00.

Former Member
0 Kudos

Hi Netanel,

Why do you expect it to display 10:001? Nope.

I would expect it to display 10:00. - precisely - now it is displaying 10:0 instead of 10:00

Thanks,

Dharmi

p.s Somehow could not give points... looks like the courtsey of new SDN look

Edited by: Dharmi Tanna on Nov 10, 2008 1:09 PM

former_member203343
Contributor
0 Kudos

Alrighty then... use this:

=REPLACE(NSTR(FLOOR(@NUM1),".0"),".","")&":"&IF((@NUM1-FLOOR(@NUM1))60<10,"0","")&REPLACE(NSTR(((@NUM1-FLOOR(@NUM1))60),".0"),".","")

Regards,

Natty

Former Member
0 Kudos

Thanks Natty.

Answers (0)