Skip to content

Commit 9707468

Browse files
committed
Merge pull request #9 from ruckus/master
QUANTTYPE should be parsed via BigDecimal
2 parents b37a784 + 826534e commit 9707468

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/qbxml/types.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Qbxml::Types
1111
TIME_CAST = Proc.new {|d| d ? Time.parse(d).xmlschema : Time.now.xmlschema }
1212
INT_CAST = Proc.new {|d| d ? Integer(d.to_i) : 0 }
1313
STR_CAST = Proc.new {|d| d ? String(d) : ''}
14+
BIGDECIMAL_CAST = Proc.new {|d| d ? BigDecimal.new(d) : 0.0}
1415

1516
TYPE_MAP= {
1617
"AMTTYPE" => FLOAT_CAST,
@@ -24,7 +25,7 @@ module Qbxml::Types
2425
"INTTYPE" => INT_CAST,
2526
"PERCENTTYPE" => FLOAT_CAST,
2627
"PRICETYPE" => FLOAT_CAST,
27-
"QUANTYPE" => INT_CAST,
28+
"QUANTYPE" => BIGDECIMAL_CAST,
2829
"STRTYPE" => STR_CAST,
2930
"TIMEINTERVALTYPE" => STR_CAST
3031
}

0 commit comments

Comments
 (0)