Path: utzoo!attcan!uunet!garfield!leif!haggas From: haggas@kean.mun.ca Newsgroups: comp.lang.c Subject: printf() float format error Message-ID: <28256@kean.mun.ca> Date: 20 Nov 89 15:26:48 GMT Organization: Computing Services, Memorial University. St.John's Nfld, Canada Lines: 14 The expression: printf("%03.0f", num); where num is a floating point number of three digits or less, eg 007 will not pad with zeros a right justified number of less than 3 digits, with Microsoft Optimizing Compiler V5.1. This expression will, however, work on a VAX 1187 using the UNIX "C" compiler. Padded zeros will be inserted if the number is an integer with the 5.1 compiler. The microcomputer is a NEC PowerMate '386, equiped with a 80287 co- processor. The Microsoft manual states in the printf() library reference that if the width argument is prefixed with a zero, the output, that is less than the specified with, will be padded zeroes. Has anyone experienced this problem and resolved it?