Introduce a +1234.56 format for over 999 steps/mm

This commit is contained in:
esenapaj
2016-11-16 07:01:30 +09:00
parent 8bf07684d2
commit 7b836a4000
5 changed files with 29 additions and 8 deletions

View File

@ -188,6 +188,21 @@ void safe_delay(millis_t ms) {
return conv;
}
// Convert signed float to string with +1234.56 format
char* ftostr62sign(const float& x) {
long xx = abs(x * 100);
conv[0] = MINUSOR(xx, '+');
conv[1] = DIGIMOD(xx, 100000);
conv[2] = DIGIMOD(xx, 10000);
conv[3] = DIGIMOD(xx, 1000);
conv[4] = DIGIMOD(xx, 100);
conv[5] = '.';
conv[6] = DIGIMOD(xx, 10);
conv[7] = DIGIMOD(xx, 1);
conv[8] = '\0';
return conv;
}
// Convert signed float to space-padded string with -_23.4_ format
char* ftostr52sp(const float& x) {
long xx = x * 100;