Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 13:10:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9QKASfj009412 for ; Sun, 26 Oct 2008 13:10:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9QKL9OE021111 for ; Sun, 26 Oct 2008 13:21:09 -0700 Message-Id: <200810262021.m9QKL9OE021111@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Dos endline character Date: Sun, 26 Oct 2008 13:21:09 -0700 From: Bill Cheng Someone wrote: > pritnf("%10ld.%03d",sec,millisec) doesn't work for me. I think its because > milisec has more than 3 digits and it doesn truncate. Am I doing something > wrong? I'm not sure how millisec can be more than 1000. But if it does, then you just need to carry it over to sec. You can do: sec = sec + (int)(((int)millisec)/((int)1000)); millisec = millisec % 1000 -- Bill Cheng // bill.cheng@usc.edu