This is a "feature" of every computer language. Just as some innocent-looking fractions have infinite decimal expansions (1/3 = 0.33333333..) the same is true in binary and, indeed, every number base, although precisely which fractions terminate and which don't varies with the chosen base.
For most business programming, quantities are ultimately required as integers or as currency and printf/sprintf is often adequate to present the desired results.
For scientific programming, there will be error tolerances in the input data and the algorithm will usually increase the magnitude of the error. It is possible (and desireable) to calculate the cumulative tolerance and the results are usually presented with only enough decimal digits to show the "accurate" data. If you are measuring lengths in metres with millimetre accuracy, for example, you would normally round to 3 dp as any following digits are meaningless artifacts of the representation, rather than valid data.
Again, printf/sprintf is usually all that is required, although sometimes you need to round rather than merely truncate. This is normally done by adding .5x10^n for some choice of n.
Yours,
fish
["]As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life was going to be spent in finding mistakes in my own programs.["]
--Maurice Wilkes, 1949