Good afternoon, tell me why sprintf does not handle some numbers and puts -000000000001 instead
while ($AllDataRowTND=$dbqueryTND->fetchrow_arrayref()){ my $f11=sprintf("%013d",@$AllDataRowTND[9]); my $lengthf11=length(@$AllDataRowTND[9]); print @$AllDataRowTND[9]," ",$f11,"\n"; } Conclusion:
147552 0000000147552 8861460504 -000000000001 3579408 0000003579408 173674665864 -000000000001 254400 0000000254400 19506120 0000019506120 78162218520 -000000000001 8259096 0000008259096 4488080280 -000000000001 2570712 0000002570712 1565484744 0001565484744 250584 0000000250584 427360243248 -000000000001 742400256 0000742400256 158498832 0000158498832 361624992816 -000000000001 59785272 0000059785272 314067564936 -000000000001 486608688 0000486608688 80281008 0000080281008 256494442128 -000000000001
print ~0 >> 1;:print ~0 >> 1;. Or this (on the command line):perl -V:[i]vsize. - PinkTux%uformat will help if we are only talking about the output of unsigned ints, not exceeding 32 bits. - PinkTux