FACT++  1.0
bool ofits::SetFloat ( const std::string &  key,
double  f,
int  p,
const std::string &  comment = "" 
)
inline

Definition at line 543 of file ofits.h.

References ofits::Key::comment, Set(), and str.

Referenced by SetDefaultKeys(), SetFloat(), and factofits::WriteDrsOffsetsTable().

544  {
545  std::ostringstream sout;
546 
547  if (p<0)
548  sout << std::setprecision(-p) << fixed;
549  if (p>0)
550  sout << std::setprecision(p);
551  if (p==0)
552  sout << std::setprecision(f>1e-100 && f<1e100 ? 15 : 14);
553 
554  sout << f;
555 
556  std::string str = sout.str();
557 
558  replace(str.begin(), str.end(), 'e', 'E');
559 
560  if (str.find_first_of('E')==std::string::npos && str.find_first_of('.')==std::string::npos)
561  str += ".";
562 
563  return Set(key, true, str, comment);
564  }
char str[80]
Definition: test_client.c:7
bool Set(const std::string &key="", bool delim=false, const std::string &value="", const std::string &comment="")
Definition: ofits.h:260

+ Here is the call graph for this function:

+ Here is the caller graph for this function: