MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / decimal_float_to_text

Function decimal_float_to_text

src/common/cvt.cpp:391–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389
390
391static void decimal_float_to_text(const dsc* from, dsc* to, DecimalStatus decSt, Callbacks* cb)
392{
393 char temp[50];
394
395 try
396 {
397 if (from->dsc_dtype == dtype_dec64)
398 ((Decimal64*) from->dsc_address)->toString(decSt, sizeof(temp), temp);
399 else if (from->dsc_dtype == dtype_dec128)
400 ((Decimal128*) from->dsc_address)->toString(decSt, sizeof(temp), temp);
401 else
402 fb_assert(false);
403 }
404 catch (const Exception& ex)
405 {
406 // reraise using function passed in callbacks
407 Arg::StatusVector v(ex);
408 cb->err(v);
409 }
410
411 dsc intermediate;
412 intermediate.dsc_dtype = dtype_text;
413 intermediate.dsc_ttype() = ttype_ascii;
414 intermediate.dsc_address = reinterpret_cast<UCHAR*>(temp);
415 intermediate.dsc_length = strlen(temp);
416
417 CVT_move_common(&intermediate, to, 0, cb);
418}
419
420
421static void int128_to_text(const dsc* from, dsc* to, Callbacks* cb)

Callers 1

CVT_move_commonFunction · 0.85

Calls 3

CVT_move_commonFunction · 0.85
dsc_ttypeMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected