kstars
Formatting Functions: Functions to perform handy formatting and conversion routines.
Functions | |
| int | fs_sexa (char *out, double a, int w, int fracbase) |
| int | f_scansexa (const char *str0, double *dp) |
| 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.
KDE 4.0 API Reference