double to string formatting

L

Lee

Hi,

I am trying to convert a double to a string using the following
format;-

double = 1.01
string = 01.0100

or

double = 0.01
string = 00.0100

now i can format the bit behind the '.' by using
double.toString("N4"), which for the first example gives me 1.0100 but
how can i format the 01. at the begining.

thanks in advance
lee
 
D

DomG

Lee said:
Hi,

I am trying to convert a double to a string using the following
format;-

double = 1.01
string = 01.0100

or

double = 0.01
string = 00.0100

now i can format the bit behind the '.' by using
double.toString("N4"), which for the first example gives me 1.0100 but
how can i format the 01. at the begining.

thanks in advance
lee

double f = 0.01;
f.ToString("00.00000")
 

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