With increasing cases of COVID-19 (corona-virus), it is advised to follow WHO precautionary measures to be safe and protect others.
  1. Alok Mandal
  2. Forum
  3. Sunday, 22 March 2020
hi guys,
i want to print the data in a table like below :


+------------+-------------------------+--------------------------+
| index | number | Description |
+------------+-------------------------+--------------------------+
| 1 | 12 | this is a long string |
| | | take two line |
+-------------+------------------------+---------------------------+
| 2 | 3456, | number is going to |
| | 68767687 | take two line |
+-------------+-------------------------+--------------------------+


data type of index and number is of int, for Description it is of string.

So basically here we are printing each of these in multilines, we can print string in multiline by using a method "

substr(i,j)
", but how can we do that for Int (number).
Responses (2)
Accepted Answer Pending Moderation
how to delete a post, where is that option :(
  1. 2 weeks ago
  2. Forum
  3. # 1
Accepted Answer Pending Moderation
You would need to represent integers as strings if you want it to be split. See the function itoa().

If you need to split into multiple lines, I guess you would first need to know the maximum characters you can put in a single column. But again this would also depend on the number of characters to pad i.e. the blank spaces between | and actual data.

If you are using UVM, you can probably get uvm_printer to print what you need in a much easier way.
  1. 2 weeks ago
  2. Forum
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy. I accept cookies from this site.

Agree