problem with decimal places in DataGrid

databases Ukraine
  • 12 years ago

    Hi, guys
    Could someone help to make DataGrid show in sells figures with 2 decimal places. Mask like ###,## neglects “0” so instead "0,20" it gives ".2" or instead "2,00" – "2."


    Thanks in advance

  • 12 years ago

    hi,
      to display data  in DataGrid with required format, we can use format function as follows.


     datagrid.textmatrix(rowno,colno)=format(datagrid.textmatrix(rowno,colno),"0.00")


    regards
    vamshi.

  • 12 years ago

    Hi vamshi
    Works perfect
    Thanks a lot


    Regards
    Holmes


Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone” - Bjarne Stroustrup