I'm doing my program on .net 7 using entity framework.
I need to format my prices like this : 1'234.56 However, they're appearing like this : 1234.56
f.Price.ToString("0.00");
The problem is that as you can see, i'm already using ToString function to round decimals to 2 after the dot.
I know I could use .ToString("N"); to format it, but i don't know how I could use both in a single ToString, my attempts were all ending by problems and the application not starting anymore.
Does anyone knows how I could format my prices with a thousand separator + only 2 decimals ?
If you are using .NET 7 you can use
ToString("N2")