I am trying to output some numbers to the log file and I ... where myVar is a float, the output looks like this: I hope to produce the output of my code at the top of this post, but clearly something is wrong Can you use a flag only once? .. or something else going on here? The width specification is the full width: to get your desired format: is currently doing this :
printf ("% 03.1f \ n", myVar);
58.0 20.0 38.0 -50.0 800.0 150.0 100.0
printf ("% 05.1 F \ n ", myVar); // pad with total width 5, 0, one digit after
printf ("% 06.1f \ N ", myVar);
Comments
Post a Comment