title: How to display output with two digits of precision
body: <p>Here is my code</p>
  
  <pre><code>class Atm
  
    attr_accessor :amount, :rem, :balance
  
    TAX = 0.50
  
    def transaction
  
      @rem = @balance=2000.00
      @amount = gets.chomp.to_f
  
      if @amount%5 != 0 || @balance &lt; @amount
        "Incorrect Withdrawal Amount(not multiple of 5) or you don't have enough balance"
      else
        @rem = @balance-(@amount+TAX)
        "Successful Transaction"
      end
    end
  end
  
  a=Atm.new
  puts "Enter amount for transaction"
  puts a.transaction
  puts "Your balance is #{a.rem.to_f}"
  </code></pre>
  
  <p>and my output is</p>
  
  <pre><code>Enter amount for transaction
  100                              # user enters this value
  Successful Transaction
  Your balance is 1899.5
  </code></pre>
  
  <p>as you can see the output, 'Your balance is 1899.5' only displays one digit of precision. I need help to understand and fix the issue. I want two digits of precision in the output.</p>
  
  <p>And also how can I improve this code?</p>