|
Mantissify C API
|
Functions | |
| int | MANTISSIFY_value (double val, char *buf, const size_t len, const MANTISSIFY_OPT_t *opt) |
| Formats a given measurement value into human friendly format. | |
| int | MANTISSIFY_text (const char *txt, char *buf, const size_t len, const MANTISSIFY_OPT_t *opt) |
| Formats all measurement values within a given text into human friendly format. | |
| int MANTISSIFY_text | ( | const char * | txt, |
| char * | buf, | ||
| const size_t | len, | ||
| const MANTISSIFY_OPT_t * | opt ) |
Formats all measurement values within a given text into human friendly format.
Note that the function uses strtod from the C standard library, therefore the parser decimal point char depend on your locale setting.
| txt | The text to convert as pointer to a const c-string |
| buf | Pointer to a buffer for the formatted result text. Pass NULL to make a 'virtual' write (like snprintf). |
| len | Length (number of bytes) of the given buffer |
| opt | Pointer to const struct with formatting options |
| int MANTISSIFY_value | ( | double | val, |
| char * | buf, | ||
| const size_t | len, | ||
| const MANTISSIFY_OPT_t * | opt ) |
Formats a given measurement value into human friendly format.
Note that the function uses snprintf from the C standard library, therefore the printed decimal point char my depend on your locale setting.
| f | The measurement value to format |
| buf | Pointer to a buffer for the formatted result text. Pass NULL to make a 'virtual' write (like snprintf). |
| len | Length (number of bytes) of the given buffer |
| opt | Pointer to const struct with formatting options |