Skip to content

Commit

Permalink
Replaced BigDecimal.new to BigDecimal()
Browse files Browse the repository at this point in the history
For 2.6.3
  • Loading branch information
promfin committed Apr 25, 2019
1 parent fd2a504 commit 36d501a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fb.c
Expand Up @@ -1300,7 +1300,7 @@ static VALUE sql_decimal_to_bigdecimal(long long sql_data, int scale)
for (i = strlen(bigdecimal_buffer); i > bigdecimal_dot; i--)
bigdecimal_buffer[i] = bigdecimal_buffer[i-1];
bigdecimal_buffer[bigdecimal_dot] = '.';
return rb_funcall(rb_path2class("BigDecimal"), rb_intern("new"), 1, rb_str_new2(bigdecimal_buffer));
return rb_funcall(rb_cObject, rb_intern("BigDecimal"), 1, rb_str_new2(bigdecimal_buffer));
}

static VALUE object_to_unscaled_bigdecimal(VALUE object, int scale)
Expand All @@ -1311,7 +1311,7 @@ static VALUE object_to_unscaled_bigdecimal(VALUE object, int scale)
ratio *= 10;
if (TYPE(object) == T_FLOAT)
object = rb_funcall(object, rb_intern("to_s"), 0);
object = rb_funcall(rb_path2class("BigDecimal"), rb_intern("new"), 1, object);
object = rb_funcall(rb_cObject, rb_intern("BigDecimal"), 1, object);
object = rb_funcall(object, rb_intern("*"), 1, LONG2NUM(ratio));
return rb_funcall(object, rb_intern("round"), 0);
}
Expand Down

0 comments on commit 36d501a

Please sign in to comment.