Results 1 to 3 of 3

Thread: [RESOLVED] How to make Listview not to truncate trailing zeroes after decimal

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    39

    Resolved [RESOLVED] How to make Listview not to truncate trailing zeroes after decimal

    Hello,

    I made a program to import data from Excel spreadsheet.

    It seems everytime datas with trailing zero will be truncated.

    For eg.

    1245.60 will turn out as 1245.6
    1245.61 appears ok - 1245.61
    1245.00 - 1245

    I want 1245.00 and 1245.60 to turn out as it is.

    Thanks,

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to make Listview not to truncate trailing zeroes after decimal

    well the listview only displays strings, so it's not the listview that's truncating the trailing 0, but rather most likely your code that's reading the data... even still when you add it to the listview, just use Format$ to format it to the correct display value.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2010
    Posts
    39

    Re: How to make Listview not to truncate trailing zeroes after decimal

    Found the solution - Format Cells in the source excel file to Text or make it non formatted.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width