use strict; my $ammount; my $value; my $response = qq{Value should be 189.81 (rounded to two decimals)} . qq{ and sprintf gives us: %.24f \n}; $ammount = 159.5; $value = $ammount * 1.19; print sprintf($response, $value); $ammount = 159.5; $value = ($ammount*119)/100; print sprintf($response, $value); #### Value should be 189.81 (rounded to two decimals) and sprintf gives us: 189.804999999999978399500833 Value should be 189.81 (rounded to two decimals) and sprintf gives us: 189.805000000000006821210263