I'm trying to display float number like this:
0.64 0 1 0.64 0.0625 1 0.64 0.125 1 0.64 0.1875 1 0.64 0.25 1 0.64 0.3125 2 0.64 0.375 2 0.64 0.4375 2 0.64 0.5 2 i know that i need to use %g but how can the spaces change ? thanks
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalI'm trying to display float number like this:
0.64 0 1 0.64 0.0625 1 0.64 0.125 1 0.64 0.1875 1 0.64 0.25 1 0.64 0.3125 2 0.64 0.375 2 0.64 0.4375 2 0.64 0.5 2 i know that i need to use %g but how can the spaces change ? thanks
%12g, or to ensure a space afterwards, reduce the "width" part of the specifier by one and add an explicit space, like:%11g %11g %d.