File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,9 @@ def pg_quote(s)
199
199
with_proto ( 'scalars { double_field: 123.456 }' ) do
200
200
test_query ( 'pgpb.test.ExampleMessage:scalars.double_field' , [ '123.456' ] )
201
201
end
202
+ with_proto ( 'scalars { double_field: 0.0000001 }' ) do
203
+ test_query ( 'pgpb.test.ExampleMessage:scalars.double_field' , [ '1e-07' ] )
204
+ end
202
205
203
206
with_proto ( 'scalars { bool_field: true }' ) do
204
207
test_query ( 'pgpb.test.ExampleMessage:scalars.bool_field' , [ 'true' ] )
Original file line number Diff line number Diff line change @@ -465,14 +465,16 @@ class PrimitiveEmitter : public Emitter {
465
465
switch (ty_) {
466
466
case T::TYPE_DOUBLE:
467
467
{
468
- char *cstr = double_to_shortest_decimal (WFL::DecodeDouble (field.value .as_uint64 ));
469
- EmitStr (std::move (std::string (cstr)));
468
+ char buf[DOUBLE_SHORTEST_DECIMAL_LEN];
469
+ double_to_shortest_decimal_buf (WFL::DecodeDouble (field.value .as_uint64 ), buf);
470
+ EmitStr (std::move (std::string (buf)));
470
471
}
471
472
break ;
472
473
case T::TYPE_FLOAT:
473
474
{
474
- char *cstr = float_to_shortest_decimal (WFL::DecodeFloat (field.value .as_uint32 ));
475
- EmitStr (std::move (std::string (cstr)));
475
+ char buf[FLOAT_SHORTEST_DECIMAL_LEN];
476
+ float_to_shortest_decimal_buf (WFL::DecodeFloat (field.value .as_uint32 ), buf);
477
+ EmitStr (std::move (std::string (buf)));
476
478
}
477
479
break ;
478
480
case T::TYPE_INT64:
You can’t perform that action at this time.
0 commit comments