Регулировка десятичной точности, .net
Эти строки в C #
decimal a = 2m;
decimal b = 2.0m;
decimal c = 2.00000000m;
decimal d = 2.000000000000000000000000000m;
Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine(c);
Console.WriteLine(d);
Создает этот вывод:
2
2.0
2.00000000
2.000000000000000000000000000
Итак, я вижу, что создание десятичной переменной из литерала позволяет мне контролировать точность.
Can I adjust the precision of decimal variables without using literals? How can I create b from a? How can I create b from c?