Mail Archives: djgpp/1998/05/09/21:16:53
Jonathan Summers wrote:
>
> Hopefully this has a simple answer.
>
> How do you right justify using fprint, so that it comes out looking
> like:
>
> 123.45
> 12.34
I would assume that fprintf() accepts the same format modifiers as
printf(), since they both call the internal function _doprnt(). Read a
C textbook to learn about them.
Quick answer:
float value = 123.45;
fprintf( "%10.2f\n", value );
--
---------------------------------------------------------------------
| John M. Aldrich |"Men rarely (if ever) manage to dream |
| aka Fighteer I |up a god superior to themselves. Most |
| mailto:fighteer AT cs DOT com |gods have the manners and morals of a |
| http://www.cs.com/fighteer |spoiled child." - Lazarus Long |
---------------------------------------------------------------------
- Raw text -