I have managed to get the sprintf statement to show the 00 on the right
side, but still having trouble with the zero's dropping out on the left side
of the decimal place, i.e. you have 250.00 it comes out 25.00, 500.00 comes
out as 5.00.   I'm at a loss what to do.  I've been reading and there's
something to do with local pc's and scalar and awk and what their set too,
but I have no idea where to look. 

Can someone look at this sprintf script and give me an idea as to how to
type it to have the  00 show up on the left side.   Any suggestions would be
appreciated.

# Output the records to the file.
$RECNUM = 0;
$RECCOUNT = 0;
while(! $RS->EOF) {
 I'm thinking now that it may be not the sprintf statement below,but where
the string is
$tmp=~s/\s+$//; #trim trailing white space 
I'm know sql, but not perl, so I'm not sure what that is saying tmp is equal
to
        for ( $i = 0; $i < $Count; $i++ ) 
        {
                $tmp = $RS->Fields($i)->value;
                $tmp =~ s/\s+$//;       # trim trailing white space
                $amt = $tmp;

                # No datachecking here!  To turn this off, set the next line
to "OFF";
                # This formats the SECOND field in the array (gotten from
the database) to a
                # currency format.
                        $DO_THIS_THING = "ON";
                        if( $i == 1 && $DO_THIS_THING eq 'ON' )
                        {
                                $amt = sprintf( "%.2f", $tmp );
                        }

                # End Sir stuff
                ###

                print OUT $amt;         #$RS->Fields($i)->value;
                print OUT "$FDELIM";
        }

        print OUT "$date\t$cid\t$caccount\t$ctype\tSJC AR
Batch\t$IDENT\t\t\t"    ;       
        print OUT "$RDELIM";
        $RECNUM++;
        $RECCOUNT++;
        if ( $RECNUM == 10) {
                print ".";
                $RECNUM = 0;
        }
        $RS->MoveNext;

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to