improved calculation of change decimal numbers