fixed a minor bug: wrong behavior when input had decimals but variable decimals is 0