Difference between %3d and %03d in sv or uvm

In reply to tgs:

Hi just take out the fallowing snippet and note the result given for different scenarios.

 module top;
integer i;//You can use any data type you want

initial
 begin
   i=2456;//Some unsigned integer value assigned to variable i 
   $display("Value of i=%3d, i====%03d, i=%0d",i,i,i);
   #10;  
   i=24; 
   $display("Value of i=%3d, i====%03d, i=%0d",i,i,i);
 end
endmodule

result:

@time=0

Value of i=   2456, i====2456, i=2456

In the above result for first “i” variable “i=%3d” means the “i” value has to be print after 3 space character, second “i” variable “i====%03d” means zero(0) represents no white space character for displaying the “i” value and here 3 represents the value of “i” should be fitted in 3 character space only, that you can check in the @10 time unit delay result, and “i=%0d” means without any white space character the “i” values has to be printed.

Result:

"time=10

Value of i= 24, i====024, i=24