How can i convert decimal to string without rounding and with specific format?
It is my value;
var price = 4569.996M;
I want to this result result = "4.569,99"
. I can check to culture for seperators like this
customCulture.NumberFormat.NumberDecimalSeparator = ",";
customCulture.NumberFormat.NumberGroupSeparator = ".";
I try some codes
var result = price.ToString("#,##0.##", CustomCulture);
//when you try this result = "4.570"
var result = Convert.ToDecimal(price).ToString("#,#.#########", customCulture);
//when you try this result = "4.569,996"
var result = price.ToString("N");
//when you try this result = "4,570.00"
var result = price.ToString("N", customCulture);
//when you try this result = "4.569,996"
My value can be any value. I just want to seperate with specific format and seperate two digit after comma and not rounding when convert to string.