+ Reply to Thread
Results 1 to 5 of 5

Get rid of thousands separator

  1. #1
    Registered User
    Join Date
    09-15-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Get rid of thousands separator

    Hi everyone. I am using VB10 to store my data to Excel. My problem is that I am trying to write my decimal number, which is stored in a String Array to Excel sheet. And my Excel doesn't store my number as decimal but as a whole number, which is separated by thousands separator. For example I have 3017,1002145 in my Array field, but when I am writing this value to excel I am getting 30,171,002,145

    How can I solve this?

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Get rid of thousands separator

    Hello snoopy9134,

    Welcome to the Forum!

    You can change the number format of your cells not to use the thousands separator.

    Format > Cells... > Number (tab) > Number (drop down)
    Look for the check box Use thousand separator. If it checked then click it to clear it.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-15-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Get rid of thousands separator

    Hi Ross, thanks for your reply. But this doesn't solve the problem. Looks like my thousands operator was already deactivated, but as I wrote, somehow, my numbers are transfered to Excel table with the thousands separation.

    here some code, I am receiving data (hex numbers, but represented in integer), therefore I have to convert the number to hex, concatenate two hex part (two parts represents whole number, two another parts represents decimal part) convert to integer, divide by some factor, concatenate then the whole and decimal parts. Convert the final decimal number to string, store it into an array.

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Get rid of thousands separator

    Hello snoopy9134,

    Another way might be to format the cell as Text. This will stop Excel from converting the string to a number. However, it also means you need the number value you will have to convert the string to number elsewhere.

  5. #5
    Registered User
    Join Date
    09-15-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Get rid of thousands separator

    thanks for your tips, looks like I had to change the decimal definition in my excel. I had "," defiende before and had to change it to ".". Now it works fine.

    Bye
    Dennis

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1