float2str converts floating point numbers to a character array. Its purpose is to have a character representation of floating point numbers when printf floating point support is not enabled by compiler options.
Revision 3:56bf83e1dd1d, committed 2016-12-09
- Comitter:
- Jens
- Date:
- Fri Dec 09 11:02:00 2016 +0100
- Parent:
- 2:b013360d489a
- Commit message:
- change to timer functionality
Changed in this revision
float2str.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r b013360d489a -r 56bf83e1dd1d float2str.h --- a/float2str.h Wed Nov 16 10:54:17 2016 +0100 +++ b/float2str.h Fri Dec 09 11:02:00 2016 +0100 @@ -109,7 +109,7 @@ ** toString: convert floating point number to */ -char *toString(float number, int digits) +char *toString(float number, uint8_t digits) { int d1; int d2; @@ -135,7 +135,7 @@ strcat(buf_out, "."); if (strlen(buf_d2) < digits) { /* adding n padding zero's if nessesary */ - for (int k=0; k < (digits - strlen(buf_d2)); k++){ + for (uint8_t k=0; k < (digits - strlen(buf_d2)); k++){ strcat(buf_out, "0"); } }