DataTypes in compact framework

S

Salim

Hi Guys,

Seems to be silly problem,but can't find the solution

my problem is i have a variable as double e.g

Dim x as double = 0.00008057

Now when i convert it to string to show in textbox it converts it to
"8.057E-05" notation

but, i actually want is 0.00008057.

I played around with formating using "N" but then it rounds to
0.00,now if i use say N6 it's fine but
this value is actually currency conversion factor so i can't fix the
rounding digit.


Can some one help me out

Regards

Salim
 
S

Sergey Bogdanov

Try something like this:

int a = (int)(d * 1000000);
d = a * 0.000001f;
t = d.ToString("f6");


Best regards,
Sergey Bogdanov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top