How can I print fraction in floating format in C ++? I researched how this format would look, but I did not find anything. E.g:
5
__
3
How can I print fraction in floating format in C ++? I researched how this format would look, but I did not find anything. E.g:
5
__
3
Solution
std::cout.unsetf(std::ios::floatfield);
std::cout.precision(2);
std::cout << "\n3[36mFração3[37m : " << static_cast< float >(this->numerador) << " 3[31m-3[37m " << static_cast< float >(this->denominador) << "\n";