Below, I will provide 2 different blocks of code: 

Code Block A, while I know there are better ways of writing it, it's where my thought process was initially going
Code Block B is a much more concise way of the aforementioned code

Code Block A: 

```
    print "How much was your meal?"
    meal_cost = Float(gets)
    meal_cost = '%.2f' % meal_cost

    print "What is the tax percentage in your state?"
    tax_percent = Float(gets)
    tax_percent = '%.2f' % tax_percent

    tax_value = meal_cost.to_f * (tax_percent.to_f * 0.01)
    tax_value = '%.2f' % tax_value

    meal_with_tax = tax_value.to_i + meal_cost.to_i
    meal_with_tax = '%.2f' % meal_with_tax

    print "What percentage would you like to tip?"
    tip_percent = Float(gets)

    tip_value = (tip_percent.to_i * 0.01) * meal_with_tax.to_i
    tip_value = '%.2f' % tip_value

    total_cost = tip_value.to_i + meal_with_tax.to_i
    total_cost = '%.2f' % total_cost

    puts "The pre-tax cost of your meal was $#{meal_cost}." 
    puts "At #{tax_percent}%, tax for this meal is $#{tax_value}."
    puts "For a #{tip_percent}% tip, you should leave $#{tip_value}."
    puts "The grand total for this meal is then $#{total_cost}"

```

Code Block B:

```
    puts "How much was your meal?"
    meal_cost = Float(gets)

    puts "Please enter your tax rate as a percentage (e.g., 12, 8.5)"
    tax_percent = Float(gets)

    puts "What percentage of your bill would you like to tip? (e.g., 15)"
    tip_percent = Float(gets)

    tax_value = meal_cost * tax_percent/100
    meal_with_tax = meal_cost + tax_value
    tip_value = meal_with_tax * tip_percent/100
    total_cost = meal_with_tax + tip_value

    print "The pre-tax cost of your meal was $%.2f.\n" % meal_cost
    print "At %d%%, tax for this meal is $%.2f.\n" % [tax_percent, tax_value]
    print "For a %d%% tip, you should leave $%.2f.\n" % [tip_percent, tip_value]
    print "The grand total for this meal is then $%.2f.\n" % total_cost

```

For some reason, in Code Block A, the following lines: 

```
    meal_with_tax = tax_value.to_i + meal_cost.to_i
    meal_with_tax = '%.2f' % meal_with_tax

```

returns 22 instead of 22.4

Can someone help me understand why?