string s1 = "10001,20002"; string s2 = s1.Substring( s1.LastIndexOf( ',' ) + 1 );
double d1 = 10001.20002; // Conversion en Decimal. decimal m1 = ( ( decimal )d1 - Decimal.Truncate( ( decimal )d1 ) ); // Conversion en String. string s1 = m1.ToString( System.Globalization.CultureInfo.InvariantCulture ); s1 = s1.Substring( s1.LastIndexOf( '.' ) + 1 );
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { double time = ((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds); double time2 = time.Substring(time.LastIndexOf(',') + 1); Console.WriteLine(time2); } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question