| 389 | |
| 390 | |
| 391 | static 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 | |
| 421 | static void int128_to_text(const dsc* from, dsc* to, Callbacks* cb) |
no test coverage detected