Hey, I'm trying to make a nice looking output, but some of the information I'm outputting is too long. I know %8s will give you 8 characters minimum, but is there anyway to do a max?
Never mind, got it here. Thanks anyway.
Hey, I'm trying to make a nice looking output, but some of the information I'm outputting is too long. I know %8s will give you 8 characters minimum, but is there anyway to do a max?
Never mind, got it here. Thanks anyway.
Last edited by jrfall349; 04-25-2007 at 05:24 PM. Reason: Got it
Sure. Put a number immediately after the decimal point:
printf("\n%15.12s", string), will give you a max of 12 char's output, in a 15 char wide field.
In a number, the 12 shown above will give you a maximum of 12 digits after the decimal point.
Edit: Too slow, foiled again.
Adak