How can convert 0.004499807884787987 to 0.0044 - page 2

 
 

   Use this NormalizeDouble( (0.004499807884787987),4);

 

omg read the effing thread before posting your responses. How many comments about Normalize when it has been demonstrated in several posts that it does not fix the op's issue.

I often use the int method demonstrated by @Dominik Egert.

 
CHARLESS11:   Use this NormalizeDouble( (0.004499807884787987),4);

sorry, @CHARLESS11 ND would change 0.00449 to 0.0045. Not what OP asked for.

 
LONNV:

I have this value  0.004499807884787987

I want only 0.0044

what math function should use

thanks

Try something like this

double num = 0.004499807884787987;

//How do you decide how many values we need after decimel? I assume by Pip value. So

double pip = _Point*10;

num = num/pip;
num = (int)num;
num = num*pip;