dimanche 12 novembre 2017

rails decimal values shows unexpected result with .9999999999 [on hold]

I am receiving a param a value with rate['row_total'] = 65.60 from request. Then in controller i get

puts "rate = #{rate['row_total']}" = 65.5999999999999

I tried BigDecimal(rate['row_total']).to_s('F') did not work

Aucun commentaire:

Enregistrer un commentaire