varaible third string after decimal point

I Experts

I have varaible with these stored
 aa = 23.5689
 bb = 58.958
cc =  58.2

I would like to find the stirng 2 places after decaimal point
so the result shoul be
for aa   6
for  bb  5
for cc   0

please help
b001Asked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
double d = 23.5689;
long l = (long)(d * 10.0);   //235
long l2 = (long)(d * 100.0); //2356

long digit = l2 - 10*l;  //6
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
What type of variable is the string ?

As you are asking in C++.net is it something like:
String^ s;
0
 
b001Author Commented:
it is double.
I am running Visual Studio 2008
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.