📅  最后修改于: 2022-03-11 15:04:43.029000             🧑  作者: Mango
printf("%0k.yf" float_variable_name)
Here k is the total number of characters you want to get printed. k = x + 1 + y (+ 1 for the dot) and float_variable_name is the float variable that you want to get printed.
Suppose you want to print x digits before the decimal point and y digits after it. Now, if the number of digits before float_variable_name is less than x, then it will automatically prepend that many zeroes before it.