Hi Patrick,
One quick way to do this is to transfer the number into a culture view
that uses periods instead of commas as does the US.
//since this uses monetary notation in front of the text it might not
be appropriate
int k = 12345;
CultureInfo dk = new CultureInfo("da-DK"); //us --> en-US
string w = k.ToString("c", dk);
Console.WriteLine (w);
you could also use the following code to do what you'd like...
using System;
using System.Globalization;
namespace test1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
int i = int.Parse("123456789");
NumberFormatInfo nfi = new CultureInfo( "en-US", false
).NumberFormat;
nfi.NumberGroupSeparator = "."; //changes from the default of
commas to periods
Console.WriteLine(i.ToString("N", nfi));
}
}
}
~~~~~~~~~~~~~
Tommie Carter
tcarternyc(at)hotmail(dot)com