Permalink
Browse files

Convert value to string before casting to decimal

  • Loading branch information...
1 parent fc75e48 commit 43f18874506e52e33f4340ca4db6819ac7d81ec7 Anthony Zacharakis committed Apr 5, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/paxmex/schema/field.rb
View
3 lib/paxmex/schema/field.rb
@@ -32,7 +32,8 @@ def parse_decimal(value)
'P' => 7, 'Q' => 8, 'R' => 9,
'{' => 0, '}' => 0)
- BigDecimal.new(value.to_i * (is_credit ? -1 : 1) / 100.0, 7)
+ parsed_value = value.to_i * (is_credit ? -1 : 1) / 100.0
+ BigDecimal.new(parsed_value.to_s, 7)
end
def parse_julian_date(date_string)

0 comments on commit 43f1887

Please sign in to comment.