Changeset 889 for cpp/frams/util/sstring.cpp
- Timestamp:
- 07/22/19 01:16:11 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/sstring.cpp
r826 r889 52 52 { 53 53 size = guessMemSize(initsize); 54 if (size > 0) 54 if (size > 0) { txt = (char*)malloc(size + 1); txt[0] = 0; } 55 55 else txt = (char*)""; 56 56 used = 0; … … 368 368 #ifdef USE_PRINTFLOAT_DRAGON4 369 369 SString tmp; 370 char* here =tmp.directWrite(30);371 tmp.endWrite(PrintFloat64(here, 30,d,372 ((d<-1e17)||(d>1e17)||((d<1e-4)&&(d>-1e-4)&&(d!=0.0)))373 374 370 char* here = tmp.directWrite(30); 371 tmp.endWrite(PrintFloat64(here, 30, d, 372 ((d < -1e17) || (d > 1e17) || ((d < 1e-4) && (d > -1e-4) && (d != 0.0))) 373 ? PrintFloatFormat_Scientific : PrintFloatFormat_Positional, 374 -1));//http://www.ryanjuckett.com/programming/printing-floating-point-numbers/ 375 375 #else 376 376 SString tmp = SString::sprintf("%.17g", d); //https://stackoverflow.com/questions/16839658/printf-width-specifier-to-maintain-precision-of-floating-point-value
Note: See TracChangeset
for help on using the changeset viewer.