Created
August 27, 2018 05:23
-
-
Save donma/94127c9e3ffb8091433056a8bb5a77e2 to your computer and use it in GitHub Desktop.
decimal to string comma.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decimal t1 = 123456.12345M; | |
decimal t2 = 123456.12345M; | |
decimal t3 = 12345678901234.123456789M; | |
Console.WriteLine(t1.ToString("#,###,###.###")); | |
//123,456.123 | |
Console.WriteLine(t2.ToString("#,###,###.####")); | |
//123,456.1235 | |
Console.WriteLine(t3.ToString()); | |
//12345678901234.123456789 | |
Console.WriteLine(GetMoneyString(t3)); | |
//12,345,678,901,234.123456789 | |
Console.ReadLine(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment