+ Reply to Thread
Results 1 to 2 of 2

Decimal Points in Custom Number Formats

  1. #1
    Registered User
    Join Date
    09-28-2011
    Location
    Upstate NY, USA
    MS-Off Ver
    2016/365
    Posts
    9

    Decimal Points in Custom Number Formats

    I'd like to have a custom format in which the decimal point is handled the way "General" handles it, i.e. the point is there if and only if there is one or more digit to come after.

    In particular, I want to add thousands separators (commas) without changing the decimals behavior. I've made a few attempts. Of course I can get the number of decimal places to grow as needed (#,###.####) but the dot still appears even for an integer.

    Before anyone says it, yes, I can do this with conditional formatting. One should not have to do that, since this is really only a number formatting matter, and conditional formatting would be a workaround.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,813

    Re: Decimal Points in Custom Number Formats

    Before anyone says it, yes, I can do this with conditional formatting. One should not have to do that, since this is really only a number formatting matter, and conditional formatting would be a workaround.
    As far as I know, Excel's number formatting has always behaved this way. Other than General, there is no number format code that makes the decimal point behave the way you describe you want it. The closest number format code is using the # after the decimal point like the #,###.#### you've already tried. As you note, Excel will display the decimal point even for integers. As far as I know, conditional formatting (that tests for the integer cases) is the only way of getting Excel to not show the decimal point. You can tell us that it shouldn't be necessary, but you really need to tell Excel's programmers that because it is up to them to change how Excel treats the decimal point in integers in that kind of number format.

    Are you restricted to Excel? I tried your number format code on some random data in LO Calc (I'm currently running version 6.4). LO Calc behaved the way you want it -- integers did not display the decimal point. I also tried Google Sheets, but it behaved the same as Excel -- displaying the decimal point for integers. If this is important enough, switching to LO Calc will resolve this particular issue around decimal points.

    I'm sorry that I don't have any good suggestions. If Excel is important to this, maybe keep up to date on your Excel updates and see if/when MSFT chooses to change this behavior in Excel.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Crazy Decimal Points Dividing A Number
    By Genus Max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2020, 12:02 PM
  2. [SOLVED] Add decimal points to a number within a formula
    By cecilia_is_the_best in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2017, 04:09 PM
  3. Replies: 2
    Last Post: 12-09-2016, 07:18 AM
  4. 'Inverse' number scaling formats for decimal fractions
    By petecollier in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2014, 09:48 AM
  5. Number won't display with decimal points
    By mbderby in forum Excel General
    Replies: 2
    Last Post: 07-03-2013, 10:49 AM
  6. [SOLVED] number has bogus decimal points
    By Librarian in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-01-2005, 08:55 PM
  7. [SOLVED] number formats default to 2 decimal points when entered so 24 bec.
    By kiddo7us in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 05:06 AM

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