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

Function decimal32FromString

extern/decNumber/decimal32.c:378–392  ·  view source on GitHub ↗

------------------------------------------------------------------ */ to-number -- conversion from numeric string */ / decimal32FromString(result, string, set); */ / result is the decimal32 format number which gets the result of */ the conversion */ string is the character string which should contain a vali

Source from the content-addressed store, hash-verified

376/* If an error occurs, the result will be a valid decimal32 NaN. */
377/* ------------------------------------------------------------------ */
378decimal32 * decimal32FromString(decimal32 *result, const char *string,
379 decContext *set) {
380 decContext dc; // work
381 decNumber dn; // ..
382
383 decContextDefault(&dc, DEC_INIT_DECIMAL32); // no traps, please
384 dc.round=set->round; // use supplied rounding
385
386 decNumberFromString(&dn, string, &dc); // will round if needed
387 decimal32FromNumber(result, &dn, &dc);
388 if (dc.status!=0) { // something happened
389 decContextSetStatus(set, dc.status); // .. pass it on
390 }
391 return result;
392 } // decimal32FromString
393
394/* ------------------------------------------------------------------ */
395/* decimal32IsCanonical -- test whether encoding is canonical */

Callers

nothing calls this directly

Calls 4

decContextDefaultFunction · 0.85
decNumberFromStringFunction · 0.85
decimal32FromNumberFunction · 0.85
decContextSetStatusFunction · 0.85

Tested by

no test coverage detected