Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Testing 001
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Globalization; namespace Rextester { public class Program { public static void Main(string[] args) { Prueba test = new Prueba(); test.Nombre = "Felix De Jesus"; test.Apellido = "Marrugo Palomino"; test.Edad = 27; test.Porcentaje = 12.5m; test.Valor = 10.25f; test.Total = Convert.ToDouble((test.Porcentaje*Convert.ToDecimal(test.Edad)) *Convert.ToDecimal(test.Valor)); DateTime serverTime = DateTime.Now; // gives you current Time in server timeZone DateTime utcTime = serverTime.ToUniversalTime();// convert it to Utc using timezone setting of server computer TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); DateTime localTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, tzi); // convert from utc to local System.Console.WriteLine("Cartagena de Indias, "+localTime.ToString("dd 'de' MMMM 'de' yyyy", CultureInfo.CreateSpecificCulture("es-CO"))); System.Console.WriteLine("\n"); System.Console.WriteLine("Hola "+test.Nombre+" "+test.Apellido +", Bienvenido al Mundo C#; Estabamos esperandote!"); System.Console.WriteLine("\n"); System.Console.WriteLine("El total es: "+test.Total); System.Console.WriteLine("\n"); System.Console.WriteLine("Valor en formato Origen: {0}", test.Valor); System.Console.WriteLine("Valor en formato Moneda: {0:C}", test.Valor); System.Console.WriteLine("Total en formato Punto Fijo: {0:F2}", test.Total); System.Console.WriteLine("Total en formato Númerico: {0:N}", test.Total); System.Console.WriteLine("Edad en formato Hexadecimal: {0:X}", test.Edad); System.Console.WriteLine("Edad en formato Decimal: {0:D5}", test.Edad); System.Console.WriteLine("\n"); System.Console.WriteLine("El total en Pesos: "+test.Total.ToString("C", CultureInfo.CreateSpecificCulture("es-CO"))); System.Console.WriteLine("\n"); System.Console.WriteLine("Fecha de la Prueba: "+ localTime.ToString("dd/MM/yyyy hh:mm:ss tt", CultureInfo.CreateSpecificCulture("es-PE")).ToUpper()); } } } public class Prueba { private string nombre, apellido; private int edad; private decimal porcentaje; private float valor; private double total; public string Nombre { get{return nombre;} set{nombre = value;} } public string Apellido { get{return apellido;} set{apellido = value;} } public int Edad { get{return edad;} set{edad = value;} } public decimal Porcentaje { get{return porcentaje;} set{porcentaje = value;} } public float Valor { get{return valor;} set{valor = value;} } public double Total { get{return total;} set{total = value;} } }
run
|
edit
|
history
|
help
0
extension methods
toplam
C# - Date Validation
C# queue
Hello
CheckingAccount
BFS ALGO
Reverse a String Using Hash Function
Alin
Trabbd