Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
c# toString(); で double (通貨) を 12 桁に変更する方法
例えば
12.50 => 000000001250
これを試して:
string value = ((decimal)(12.50 * 100)).ToString().PadLeft(12, '0');
int a = (int)(12.50 * 100); Console.WriteLine((a).ToString("D12"));