10 進数と整数の桁数を返す関数を作成し、挿入されtypenameた数値を s を使用して文字列に変換していますsstream。
ただし、文字列に変換されたときの数値は、桁数を数えるのに役立たない科学的表記法で出てきますが、通常の数値です。以下の関数でこれが発生しないようにするにはどうすればよいですか?
enum { DECIMALS = 10, WHOLE_NUMBS = 20, ALL = 30 };
template < typename T > int Numbs_Digits(T numb, int scope)
{
    stringstream ss(stringstream::in | stringstream::out);
    stringstream ss2(stringstream::in | stringstream::out);
    unsigned long int length = 0;
    unsigned long int numb_wholes;
    ss2 << (int) numb;
    numb_wholes = ss2.str().length();
    ss2.flush();
    bool all = false;
    switch (scope) {
    case ALL:
        all = true;
    case DECIMALS:
        ss << numb;
        length += ss.str().length() - (numb_wholes + 1);  // +1 for the "."
        if (all != true)
            break;
    case WHOLE_NUMBS:
        length += numb_wholes;
        if (all != true)
            break;
    default:
        break;
    }
    return length;
}