print float number with only four places after the decimal point in c++

#include <iostream>
#include <iomanip>

int main() {
    float number = 123.45678f;
    std::cout << std::fixed << std::setprecision(4) << number << std::endl;
    return 0;
}