MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_asNumberArrayString

Function UArray_asNumberArrayString

libs/basekit/source/UArray_utf.c:138–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138UArray *UArray_asNumberArrayString(const UArray *self) {
139 UArray *out = UArray_new();
140 UArray_setEncoding_(out, CENCODING_ASCII);
141
142 UARRAY_INTFOREACH(
143 self, i, v, char s[128];
144
145 if (UArray_isFloatType(self)) { sprintf(s, "%f", (double)v); } else {
146 sprintf(s, "%i", (int)v);
147 }
148
149 if (i != UArray_size(self) - 1) strcat(s, ", ");
150 UArray_appendBytes_size_(out, (unsigned char *)s, strlen(s)););
151
152 return out;
153}
154
155UArray *UArray_asUTF8(const UArray *self) {
156 UArray *out = UArray_new();

Callers 1

UArray_asUTF8Function · 0.85

Calls 5

UArray_newFunction · 0.85
UArray_setEncoding_Function · 0.85
UArray_isFloatTypeFunction · 0.85
UArray_sizeFunction · 0.85
UArray_appendBytes_size_Function · 0.85

Tested by

no test coverage detected