List Info

Thread: Remove x number of decimals form a float




Remove x number of decimals form a float
user name
2006-07-11 18:12:25
Hello,

I am trying to implement a 100% math function ( avoid handle
the float as 
a char array), that remove x number of decimals from the
right to the 
float point.

Example:
Given x= 12345.6789 I call the function with (x,2) and the
returned number 
is: x= 12345.67, for (x,4) returned value is x=12345

I was trying to implement this function using datatype
casting, abs() and 
other functions from math.h library.

Thanks for any advice,


---
Fabio Andres Miranda
Ingenieria de sistemas informaticos
Universidad Latina - Costa Rica

-
To unsubscribe from this list: send the line
"unsubscribe linux-c-programming" in
the body of a message to majordomovger.kernel.org
More majordomo info at  http://vge
r.kernel.org/majordomo-info.html
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )