FloatTryToStr
Description
Convert a float to a decimal string. Two forms via argument count:
FloatTryToStr(out, value)- usesvalue’s allocator.FloatTryToStr(out, value, alloc)- uses the explicit allocator.
Success
Returns true. *out holds the decimal representation.
Failure
Returns false on allocation failure. *out is left in a valid but unspecified state.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Float.Leak.c:273:
Str out = StrInit(&dbg.base);
bool ok = FloatTryToStr(&out, &v);
FloatDeinit(&v);- In
Float.Leak.c:288:
Str out = StrInit(&dbg.base);
bool ok = FloatTryToStr(&out, &v);
FloatDeinit(&v);
bool test_float_try_to_str_allocator_inheritance(void) {
WriteFmt("Testing FloatTryToStr allocator behavior\n");
DefaultAllocator alloc = DefaultAllocatorInit();
Last updated on