Skip to content

Cross-platform C library for representing numbers in human readable form using magnitudes (kilo, mega, giga, ...)

License

Notifications You must be signed in to change notification settings

brechtsanders/scalednum

Repository files navigation

scalednum

Cross-platform C library for representing numbers in human readable form using magnitudes (kilo, mega, giga, ...).

minimal example

The following application:

#include "scalednum.h"
#include <stdio.h>

int main ()
{
  scalednum w = scalednum_create(3, SCALEDNUM_KILO1000 | SCALEDNUM_LONGPREFIX, "Watts", "Watt");
  scalednum_print(w, 2400000);
  scalednum_free(w);
  return 0;
}

will return the following output:

2.40 megaWatts

GitHub Actions CI

GitHub-CI for scalednum