SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    East of Ottawa, ON
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Numerical suffixes

    When exporting data from a listview (web form) to excel one of the fields is a long type and and numerical suffix get added. Is there a way to have the full number appear without the suffix?

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    How are you exporting the data?

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    East of Ottawa, ON
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a function that receives a generic list and then creates a csv file.

    when I open it it Excel a value of 30000000000 will be displayed has 3E+12

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    That would be scientific notation and it is all on excel's end of the world. And it is pretty tricky to get around if you have to pass in flat files, such as CSV, as there is no way to indicate that it should show this column as a number with format X. To get past it, you'll need some better ways of generating excel. I recommend either CarlosAG's excel xml writer or using the excellent excelpackage library.

    That is a function of the way excel formats data without any input -- which is what happens when you have

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    East of Ottawa, ON
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the info.

    After doing some research I found a way of making it work.

    I check if the value is of type long and convert it to a string.

    ("=""" & value.ToString & """") will display the full number.


Bookmarks

Posting Permissions

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