예제 #1
0
 // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
 char *ftostr4sign(const float& fx) {
   const int x = fx * 10;
   if (!WITHIN(x, -99, 999)) return itostr4sign((int)fx);
   const bool neg = x < 0;
   const int xx = neg ? -x : x;
   conv[3] = neg ? '-' : (xx >= 100 ? DIGIMOD(xx, 100) : ' ');
   conv[4] = DIGIMOD(xx, 10);
   conv[5] = '.';
   conv[6] = DIGIMOD(xx, 1);
   return &conv[3];
 }
예제 #2
0
 // Convert float to rj string with _123, -123, _-12, or __-1 format
 char *ftostr4sign(const float& x) { return itostr4sign((int)x); }