Table cell data format

Table cell data format

Anonymous
Not applicable
409 Views
2 Replies
Message 1 of 3

Table cell data format

Anonymous
Not applicable
Hi there, i have created a table with 3 column, the first an second column is integer and the third column is the division of the other two.
=A1/B1

the problem is the output has a lot of trailing zero. I notice in autocad itself, you can select the cell, choose data format and change the precision. But how do i do it in vb?
0 Likes
410 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi whtam,

When you write the data to the cell use the Format function to display
the number of decimal places you require.

MyFormattedString = Format(MyNumber, "#0.000")


Regards


Laurie Comerford

whtam wrote:
> Hi there, i have created a table with 3 column, the first an second column is integer and the third column is the division of the other two.
> =A1/B1
>
> the problem is the output has a lot of trailing zero. I notice in autocad itself, you can select the cell, choose data format and change the precision. But how do i do it in vb?
0 Likes
Message 3 of 3

Anonymous
Not applicable
I set the cell value with

Table.SetText(0,2,"=A1/B1")

format doesnt work..
0 Likes