void GetInsurance() { cout << "\nInsurance Types:\n" << "(0) No Insurance\n" << "(1) HMO\n(2) PPO\nEnter Insurance Type(0,1,2): "; cin >> patient_insurance; if (patient_insurance == "0") GetDays(); else if (patient_insurance == "1") GetDays(); else if (patient_insurance == "2") GetDays(); else { GiveError(); GetInsurance(); } }
FString FTimespan::ToString() const { if (GetDays() == 0) { return ToString(TEXT("%n%h:%m:%s.%f")); } return ToString(TEXT("%n%d.%h:%m:%s.%f")); }
CString CSPTimeSpan::Format(LPCTSTR pFormat) const // formatting timespans is a little trickier than formatting CSPTimes // * we are only interested in relative time formats, ie. it is illegal // to format anything dealing with absolute time (i.e. years, months, // day of week, day of year, timezones, ...) // * the only valid formats: // %D - # of days -- NEW !!! // %H - hour in 24 hour format // %M - minute (0-59) // %S - seconds (0-59) // %% - percent sign { TCHAR szBuffer[maxTimeBufferSize]; TCHAR ch; LPTSTR pch = szBuffer; while ((ch = *pFormat++) != '\0') { ASSERT(pch < &szBuffer[maxTimeBufferSize]); if (ch == '%') { switch (ch = *pFormat++) { default: ASSERT(FALSE); // probably a bad format character case '%': *pch++ = ch; break; case 'D': pch += wsprintf(pch, _T("%ld"), GetDays()); break; case 'H': pch += wsprintf(pch, _T("%02d"), GetHours()); break; case 'M': pch += wsprintf(pch, _T("%02d"), GetMinutes()); break; case 'S': pch += wsprintf(pch, _T("%02d"), GetSeconds()); break; } } else { *pch++ = ch; if (_istlead(ch)) { ASSERT(pch < &szBuffer[maxTimeBufferSize]); *pch++ = *pFormat++; } } } *pch = '\0'; return szBuffer; }
A2Date* A2Date::Add(s32 i) { if (date.d+i < aDays[date.m-1]) { date.d += i; return this; } SetDate(GetDays() + i); return this; }
double DataNeuron::GetBidSellAvg_5(int32_t type, int32_t bidSell) { DataNeuron* nowNeuron = this; double result = 0; int32_t days = GetDays(type); int32_t dayCount = days; while (dayCount-- != 0) { if (type == 15) { if (bidSell == 1) { result += nowNeuron->m_bid_15days_5; } else if (bidSell == 2) { result += nowNeuron->m_sell_15days_5; } } else if (type == 30) { if (bidSell == 1) { result += nowNeuron->m_bid_30days_5; } else if (bidSell == 2) { result += nowNeuron->m_sell_30days_5; } } else { if (bidSell == 1) { result += nowNeuron->m_bid_90days_5; } else if (bidSell == 2) { result += nowNeuron->m_sell_90days_5; } } if (nowNeuron->m_preData == nullptr) { break; } nowNeuron = nowNeuron->m_preData; } return result / days; }
FString FTimespan::ToString( const TCHAR* Format ) const { FString Result; while (*Format != TCHAR('\0')) { if ((*Format == TCHAR('%')) && (*++Format != TCHAR('\0'))) { switch (*Format) { case TCHAR('n'): if (Ticks < 0) Result += TCHAR('-'); break; case TCHAR('N'): Result += (Ticks < 0) ? TCHAR('-') : TCHAR('+'); break; case TCHAR('d'): Result += FString::Printf(TEXT("%i"), FMath::Abs(GetDays())); break; case TCHAR('h'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetHours())); break; case TCHAR('m'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetMinutes())); break; case TCHAR('s'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetSeconds())); break; case TCHAR('f'): Result += FString::Printf(TEXT("%03i"), FMath::Abs(GetMilliseconds())); break; case TCHAR('D'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalDays())); break; case TCHAR('H'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalHours())); break; case TCHAR('M'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalMinutes())); break; case TCHAR('S'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalSeconds())); break; case TCHAR('F'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalMilliseconds())); break; default: Result += *Format; } } else { Result += *Format; } ++Format; } return Result; }
double DataNeuron::GetMinMaxUpDown_5(int32_t realDays, bool isMin) { double min = 10000; double max = -10000; DataNeuron* nowNeuron = this; int32_t days = GetDays(realDays); while (days-- != 0) { if (isMin) { if (nowNeuron->m_upDown_5 < min) { min = nowNeuron->m_upDown_5; } } else { if (nowNeuron->m_upDown_5 > max) { max = nowNeuron->m_upDown_5; } } if (nowNeuron->m_preData == nullptr) { break; } nowNeuron = nowNeuron->m_preData; } if (isMin) { return min; } else { return max; } }
LONG CMSTimeSpan::GetHours() const throw() { return( LONG( GetTotalHours()-(GetDays()*24) ) ); }
long sltimespan::GetHours() const throw() { return( long( GetTotalHours()-(GetDays()*24) ) ); }