Question : How do I chop off extra decimal places?

Let's say the result of a calculation yields a float variable whose value is 6.3151.

I want to chop off the .3151 instead of rounding it.  How do I do this?

Thus, if the value were instead 6.8132 I want to end up with a 6 instead of rounding up to a 7.

Answer : How do I chop off extra decimal places?

Random Solutions  
 
programming4us programming4us