MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / SzOffset

Function SzOffset

general.cpp:2034–2062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2032// separately, or display one combined value for the overall offset.
2033
2034char *SzOffset(real zon, real dst, real lon)
2035{
2036 static char szOff[15], *pch;
2037 real off;
2038 int min;
2039 flag fLMT;
2040
2041 if (!us.fOffsetOnly)
2042 sprintf(szOff, "%cT %s%s", ChDst(dst), !f1K ? "Zone " : "", SzZone(zon));
2043 else {
2044 fLMT = (zon == zonLMT || zon == zonLAT);
2045 if (dst == dstAuto)
2046 dst = (real)is.fDst;
2047 off = (!fLMT ? zon - dst : lon - dst*15.0);
2048 if (is.fZoneMeridian) {
2049 off = (zon - dst)*15.0;
2050 fLMT = fTrue;
2051 }
2052 min = (int)(RFract(RAbs(off))*60.0 + rSmall);
2053 sprintf(szOff, "Zone %c%d%c", !fLMT ? 'h' : 'm', NAbs((int)off),
2054 off > 0.0 ? 'w' : 'e');
2055 if (min != 0) {
2056 for (pch = szOff; *pch; pch++)
2057 ;
2058 sprintf(pch, "%02d", min);
2059 }
2060 }
2061 return szOff;
2062}
2063
2064
2065// Nicely format the given longitude and latitude locations and return them

Callers 5

DrawInfoFunction · 0.85
DrawChartXFunction · 0.85
ChartTransitSearchFunction · 0.85
PrintHeaderFunction · 0.85
PrintWheelCenterFunction · 0.85

Calls 1

SzZoneFunction · 0.85

Tested by

no test coverage detected