IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 27, 2009, 1:09:31 PM (17 years ago)
Author:
Paul Price
Message:

Make the number of decimals used by psTimeToISO configurable. MySQL can't handle more than 6 decimals (and it strips those off anyway). By doing this, we can keep MySQL happy, and still preserve the option of printing everything.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psTime.c

    r22705 r22710  
    6161static char *timeConfig = NULL;         // Time config file path
    6262static psMetadata *timeMetadata = NULL; // Time metadata read from config file
     63static int isoDecimals = 6;             // Number of decimals to use in a string by psTimeToISO
    6364
    6465
     
    13531354}
    13541355
     1356
     1357int psTimeSetISODecimals(int num)
     1358{
     1359    int temp = isoDecimals;          // Current value, to return
     1360    isoDecimals = num;
     1361    return temp;
     1362}
     1363
     1364int psTimeGetISODecimals(void)
     1365{
     1366    return isoDecimals;
     1367}
     1368
    13551369psString psTimeToISO(const psTime *time)
    13561370{
    1357     return timeToString(time, 9);       // Use all 9 decimals allowed by the nanoseconds
     1371    return timeToString(time, isoDecimals);
    13581372}
    13591373
Note: See TracChangeset for help on using the changeset viewer.