| 2032 | // separately, or display one combined value for the overall offset. |
| 2033 | |
| 2034 | char *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 |
no test coverage detected