From: "Abinoam Jr." Date: 2010-12-22T11:59:48+09:00 Subject: Re: User Input Integers On Tue, Dec 21, 2010 at 11:41 PM, flebber wrote: > using 1.9.1 > I have google searched this but there seems to be a very broad array > of answers none very consistent. :-) :-D Sorry... but I really don't believe it! > Can someone put to bed the exact way to get user input with "Integers" > and specify how many decimals to output too in this case 2 decimals. Yes! To do your home work? Ok :-) > Here is a basic program(not working) to calculate netpay. > puts "How many hours did you work?" > hours = gets.chomp()._to.i > puts "What is your tax rate?" > taxrate = gets.chomp()._to.i > tax = (100 - taxrate) > netpay = ((hours * 12.00) *  tax)) > puts "Your netpay is, $" $netpay Use this code bellow solely as a guide. puts "How many hours did you work?" hours = gets.chomp().to_i puts "What is your tax rate?" taxrate = gets.chomp().to_i tax = (100 - taxrate) netpay = ((hours * 12.00) * tax) printf "Your netpay is, US$ %.2f", netpay Aside the code errors, I think your calcs are wrong. Wouldn't it be something like... netpay = ((hours * 12.00) * tax) / 100 # with this 100 dividing it. Abinoam Jr.