Is there a custom format specifier that multiply a number per either 1000 or 1000,000? For example, given <some specifier> custom specifier:
double value = 1;
Console.WriteLine(value.ToString("#,##0<somespecifier>", CultureInfo.InvariantCulture));
// Displays 1,000,000
This will basically be the opposite of
“,,” custom specifier:
double value = 1234567890;
Console.WriteLine(value.ToString("#,##0,,", CultureInfo.InvariantCulture));
// Displays 1,235
Thanks in advance for any help.
There is not something like that built in but you could easily create an extension method to do just that:
And usage would be as follows: