FirebaseAuth Сбой на API 21, но если его API 23 выше, он работает нормально

Вы были почти там, нужно также использовать std :: fixed, см. http://www.cplusplus.com/reference/iostream/manipulators/fixed/

#include 
#include 

int main(int argc, char** argv)
{
    float testme[] = { 0.12345, 1.2345, 12.345, 123.45, 1234.5, 12345 };

    std::cout << std::setprecision(2) << std::fixed;

    for(int i = 0; i < 6; ++i)
    {
        std::cout << testme[i] << std::endl;
    }

    return 0;
}

выходов:

0.12
1.23
12.35
123.45
1234.50
12345.00

0
задан Linschlager 16 January 2019 в 09:38
поделиться