towndwarf: (Default)
[personal profile] towndwarf
У меня проект "достался по наследству". В нём дофигищща исходников.
Я 2 дня искал один баг пока не наткнулся на эту потрясающую функцию (что используется примерно раз в секунду или чаще)


double DB_ADOGeneral::FloatToDouble(float floatNum, int precision)
// DESCRIPTION: Converts namber of tupe float to double tupe,
// The precision value specifies the number of digits
// after the decimal point.
/////////////////////////////////////////////////////////////////
{
    TCHAR* tc[40];
    CString cs;
    LPTSTR endptr;
    double db = 0;
    cs.Format(_T("%.*f"),precision,floatNum);
    tc = new TCHAR[cs.GetLength()-1];
    memset(tc,'\0',sizeof(tc));
    lstrcpy(tc,cs);
    db = _tcstod(tc,&endptr);
    return db;
}

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

towndwarf: (Default)
towndwarf

June 2019

S M T W T F S
      1
2345678
9 1011121314 15
161718192021 22
2324252627 2829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 27th, 2026 08:15 am
Powered by Dreamwidth Studios