You can do it like this:
printf("%.6f", myFloat);
6 represents the number of digits after the decimal separator.
More Related Contents:
- Why does >= operator work as > operator in C when compared with 0.9 [duplicate]
- Correct format specifier for double in printf
- ‘float’ vs. ‘double’ precision
- How to compare double numbers?
- What’s the use of suffix `f` on float value
- Simd matmul program gives different numerical results
- How to convert string to float?
- Floating point comparison `a != 0.7` [duplicate]
- How to extract the decimal part from a floating point number in C?
- C: Casting minimum 32-bit integer (-2147483648) to float gives positive number (2147483648.0)
- Are floating point operations in C associative?
- Convert double/float to string
- Comparing float and double in C
- Ranges of floating point datatype in C?
- Is it safe to assume floating point is represented using IEEE754 floats in C?
- Is there a tool to know whether a value has an exact binary representation as a floating point variable?
- problems in floating point comparison [duplicate]
- Is my fma() broken?
- C – Serialization of the floating point numbers (floats, doubles)
- C: How to wrap a float to the interval [-pi, pi)
- Variadic function (va_arg) doesn’t work with float?
- sin, cos, tan and rounding error
- Why does printf print random value with float and integer format specifier
- What precisely does the %g printf specifier mean?
- Is there a document describing how Clang handles excess floating-point precision?
- Why do you need an explicit `-lm` compiler option? [duplicate]
- pow() cast to integer, unexpected result
- C fundamentals: double variable not equal to double expression?
- C dynamically printf double, no loss of precision and no trailing zeroes
- How can floating point calculations be made deterministic?