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.Threadin g;
using System.Globaliz ation;
class Class1
{
static void Main()
{
Thread.CurrentT hread.CurrentCu lture = new CultureInfo("en-us");
double MyDouble = 123456789;
Console.WriteLi ne("The examples in en-US culture.\n");
Console.WriteLi ne(MyDouble.ToS tring("C"));
Console.WriteLi ne(MyDouble.ToS tring("E"));
Console.WriteLi ne(MyDouble.ToS tring("P"));
Console.WriteLi ne(MyDouble.ToS tring("N"));
Console.WriteLi ne(MyDouble.ToS tring("F"));
Thread.CurrentT hread.CurrentCu lture = new CultureInfo("de-DE");
Console.WriteLi ne("The examples in de-DE culture.\n");
Console.WriteLi ne(MyDouble.ToS tring("C"));
Console.WriteLi ne(MyDouble.ToS tring("E"));
Console.WriteLi ne(MyDouble.ToS tring("P"));
Console.WriteLi ne(MyDouble.ToS tring("N"));
Console.WriteLi ne(MyDouble.ToS tring("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**********@g reydigital.no-spam.no> wrote in message
news:bl******** **@news.tdcnorg e.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.Roun d) float's to 7 decimals, double's to 15
and decimals to 28 decimals, but that does not help.
And the System.Globaliz ation.NumberFor matInfo class does not seem to
provide a such function.
Thank you
Regards, Dennis