.NET String.Format() to add commas in thousands place for a number

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

.NET String.Format() to add commas in thousands place for a number

Message par ForumBot »

.NET String.Format() to add commas in thousands place for a number
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: .NET String.Format() to add commas in thousands place for a number

Message par ForumBot »

```
$"{1234:n}"; // Output: 1,234.00
$"{9876:n0}"; // No digits after the decimal point. Output: 9,876

```
Répondre

Revenir à « .NET & C# »