本文整理汇总了C#中Converter.ConvertInGrn方法的典型用法代码示例。如果您正苦于以下问题:C# Converter.ConvertInGrn方法的具体用法?C# Converter.ConvertInGrn怎么用?C# Converter.ConvertInGrn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter.ConvertInGrn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSomething
public void DoSomething()
{
double usd, eur, rub;
string m = "";
double cash;
Console.WriteLine("Input USD rate");
usd = double.Parse(Console.ReadLine());
Console.WriteLine("Input EUR rate");
eur = double.Parse(Console.ReadLine());
Console.WriteLine("Input RUB rate");
rub = double.Parse(Console.ReadLine());
Converter Conv = new Converter(usd , eur , rub);
Console.WriteLine("0 - Convert into grn");
Console.WriteLine("1 - Convert from grn");
m = Console.ReadLine();
switch (m)
{
case "0":
{
Console.WriteLine("Inpun cash");
cash = double.Parse(Console.ReadLine());
Console.WriteLine("Input currency");
switch (Console.ReadLine())
{
case "usd":
{
Console.WriteLine(Conv.ConvertInGrn(ExchRate.usd, cash));
break;
}
case "eur":
{
Console.WriteLine(Conv.ConvertInGrn(ExchRate.eur, cash));
break;
}
case "rub":
{
Console.WriteLine(Conv.ConvertInGrn(ExchRate.rub, cash));
break;
}
default:
{
Console.WriteLine("Error!");
break;
}
}
break;
}
case "1":
{
Console.WriteLine("Inpun cash");
cash = double.Parse(Console.ReadLine());
Console.WriteLine("Input currency");
switch (Console.ReadLine())
{
case "usd":
{
Console.WriteLine(Conv.ConvertFromGrn(ExchRate.usd, cash));
break;
}
case "eur":
{
Console.WriteLine(Conv.ConvertFromGrn(ExchRate.eur, cash));
break;
}
case "rub":
{
Console.WriteLine(Conv.ConvertFromGrn(ExchRate.rub, cash));
break;
}
default:
{
Console.WriteLine("Error!");
break;
}
}
break;
}
default:
{
Console.WriteLine("Error!");
break;
}
}
}