Hi,
You could just play with format specification strings like in this MSDN
example from the
"Standard Numeric Format Strings" topic:
using System;
using System.Threading;
using System.Globalization;
class Class1
{
static void Main()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
double MyDouble = 123456789;
Console.WriteLine("The examples in en-US culture.\n");
Console.WriteLine(MyDouble.ToString("C"));
Console.WriteLine(MyDouble.ToString("E"));
Console.WriteLine(MyDouble.ToString("P"));
Console.WriteLine(MyDouble.ToString("N"));
Console.WriteLine(MyDouble.ToString("F"));
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Console.WriteLine("The examples in de-DE culture.\n");
Console.WriteLine(MyDouble.ToString("C"));
Console.WriteLine(MyDouble.ToString("E"));
Console.WriteLine(MyDouble.ToString("P"));
Console.WriteLine(MyDouble.ToString("N"));
Console.WriteLine(MyDouble.ToString("F"));
}
}
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Dennis Myr?n" <de**********@greydigital.no-spam.no> wrote in message
news:bl**********@news.tdcnorge.no...
Hi.
Is there a way to make sure that float, double and decimal data types
never will be presented in a scientific notation?
I have tried to round(Math.Round) float's to 7 decimals, double's to 15
and decimals to 28 decimals, but that does not help.
And the System.Globalization.NumberFormatInfo class does not seem to
provide a such function.
Thank you
Regards, Dennis