One admittedly ineligant way to do this is to convert the text to a double/decimal/single and then do this:
someVariable.ToString("c");
where someVariable is a double/decimal/single.
I would use the parse command to get the double of it like this:
someVariable = double.Parse(txt, NumberFormatStyles.Any);
Just to make sure everything is included. Note that percents are not accepted by the parse command even if you choose Any for number format styles. This is a bug in the framework if you ask me.... |