• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kstars

Formatting Functions: Functions to perform handy formatting and conversion routines.


Functions

int f_scansexa (const char *str0, double *dp)
int fs_sexa (char *out, double a, int w, int fracbase)
void getSexComponents (double value, int *d, int *m, int *s)
int numberFormat (char *buf, const char *format, double value)
const char * timestamp (void)

Function Documentation

int f_scansexa ( const char *  str0,
double *  dp 
)

convert sexagesimal string str AxBxC to double.

x can be anything non-numeric. Any missing A, B or C will be assumed 0. Optional - and + can be anywhere.

Parameters:
str0 string containing sexagesimal number.
dp pointer to a double to store the sexagesimal number.
Returns:
return 0 if ok, -1 if can't find a thing.

int fs_sexa ( char *  out,
double  a,
int  w,
int  fracbase 
)

Converts a sexagesimal number to a string.

sprint the variable a in sexagesimal format into out[].

Parameters:
out a pointer to store the sexagesimal number.
a the sexagesimal number to convert.
w the number of spaces in the whole part.
fracbase is the number of pieces a whole is to broken into; valid options:
  • 360000: <w>:mm:ss.ss
  • 36000: <w>:mm:ss.s
  • 3600: <w>:mm:ss
  • 600: <w>:mm.m
  • 60: <w>:mm
Returns:
number of characters written to out, not counting final null terminator.

void getSexComponents ( double  value,
int *  d,
int *  m,
int *  s 
)

int numberFormat ( char *  buf,
const char *  format,
double  value 
)

Fill buffer with properly formatted INumber string.

Parameters:
buf to store the formatted string.
format format in sprintf style.
value the number to format.
Returns:
length of string.

const char* timestamp ( void   ) 

Create an ISO 8601 formatted time stamp.

The format is YYYY-MM-DDTHH:MM:SS

Returns:
The formatted time stamp.

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal