How to make the integer in Hours,min and sec format

Сonversation on different topics
Post Reply
harnekdeveloper26
Posts: 3
Joined: Thu May 17, 2012 10:36 am
Location: Jalandhar

How to make the integer in Hours,min and sec format

Post by harnekdeveloper26 »

Hello friends,
I am having two integer values like 3600 and 4500 i want to add this two integer and show the sum in Hours ,Min and sec , for e.g 1Hour,2Mins,3secs.Please any one can help me with this its urgent , i am working stimulsoft silverlight report.

Thanks,
Harnek
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How to make the integer in Hours,min and sec format

Post by HighAley »

Hello.
harnekdeveloper26 wrote:I am having two integer values like 3600 and 4500 i want to add this two integer and show the sum in Hours ,Min and sec , for e.g 1Hour,2Mins,3secs.Please any one can help me with this its urgent , i am working stimulsoft silverlight report.
What do 3600 and 4500 values mean? Minutes? Seconds?

Thank you.
harnekdeveloper26
Posts: 3
Joined: Thu May 17, 2012 10:36 am
Location: Jalandhar

How to make the integer in Hours,min and sec format

Post by harnekdeveloper26 »

Hello Aleksey Andreyanov,
Thanks for reply, actually 3600 is an integer value to whom i have to convert in Hours,Seconds and Mins Format,i need expression for this

HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How to make the integer in Hours,min and sec format

Post by HighAley »

Hello.
harnekdeveloper26 wrote:Thanks for reply, actually 3600 is an integer value to whom i have to convert in Hours,Seconds and Mins Format,i need expression for this
Do you use Native Silverlight or Client/Server?
Please send us exact example of what you have and what are you trying to get.

Thank you.
harnekdeveloper26
Posts: 3
Joined: Thu May 17, 2012 10:36 am
Location: Jalandhar

How to make the integer in Hours,min and sec format

Post by harnekdeveloper26 »

Hello Aleksey,
I am using Native Silverlight, ok i give u one example , i have one record in decimals like this 0.77777722 i multiply this by 3600 to convert it to seconds, now the seconds which i get after multiplying is in integer format but i want to show this integer in Hours,Min and Sec format(Like 1Hour,2Mins,3Secs) and i want to do this from Report by making Formula field, so what will be the expression for this.
Thanks,
Harnek.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How to make the integer in Hours,min and sec format

Post by HighAley »

Hello, Harnek.
harnekdeveloper26 wrote:I am using Native Silverlight, ok i give u one example , i have one record in decimals like this 0.77777722 i multiply this by 3600 to convert it to seconds, now the seconds which i get after multiplying is in integer format but i want to show this integer in Hours,Min and Sec format(Like 1Hour,2Mins,3Secs) and i want to do this from Report by making Formula field, so what will be the expression for this.
You should use next expression:

Code: Select all

{Truncate(tt).ToString() + " hour " +
 Truncate((tt - Truncate(tt)) * 60).ToString() + " min " +
 Truncate((tt * 60 - Truncate((tt - Truncate(tt)) * 60)) * 60).ToString() + " sec"}
Where tt is your decimal value. For example, 0.77777722.

Thank you.
Post Reply