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

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

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

Message par Clippy »

.NET String.Format() to add commas in thousands place for a number
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

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

Message par Clippy »

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

```
Répondre

Revenir à « .NET & C# »