I need to work with decimals. In my program, the user need to put a number with decimals to convert that number.
The problem is: If I try to convert the argument into a
You also can use the decimal class for it
a = '2.45' Decimal(a) # => 2.45
UPDATE:
Use bigdecimal as @bigtex777 mentioned:
source: http://ruby-doc.org/stdlib-2.2.2/libdoc/bigdecimal/rdoc/BigDecimal.html