- total = retail_rate(rates) - cost = body[:items].map { |item| item[:quantity] * item[:value] }.sum .half.shipping span Shipping span = rates.first["postage_type"] ' strong= "$#{'%.2f' % total}" ' = rates.first["delivery_days"] ' days .half span Total strong= "$#{'%.2f' % (cost + total)}" input type="hidden" name="amount" value=(cost + total)