31 lines
701 B
C#
31 lines
701 B
C#
using System;
|
|
|
|
namespace MoonProTablet.WebUserControls
|
|
{
|
|
public partial class mod_pianoProdMacc : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
public string TCMinSec(object _TC)
|
|
{
|
|
string TC_MinSec = "";
|
|
decimal TC = 0;
|
|
decimal.TryParse(_TC.ToString(), out TC);
|
|
int min = 0;
|
|
int sec = 0;
|
|
try
|
|
{
|
|
// cerco di convertire in min/sec
|
|
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(TC)));
|
|
sec = Convert.ToInt32((Convert.ToDouble(TC) - min) * 60);
|
|
TC_MinSec = string.Format("{0}:{1:00}", min, sec);
|
|
}
|
|
catch
|
|
{ }
|
|
return TC_MinSec;
|
|
}
|
|
|
|
}
|
|
} |