+ Reply to Thread
Results 1 to 4 of 4

number format like %g from C

  1. #1
    Registered User
    Join Date
    10-21-2010
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2003
    Posts
    5

    number format like %g from C

    Hey folks,

    there's this neat number format %g that you can use in C, C++ and so on for the function printf(). It's the shorter version of %e. It's the more compact version of %e or %f as insignificant zeros do not print, as defined in: "ANSI specification X3.159-1989: "Programming Language C," ANSI, 1430 Broadway, New York, NY 10018".

    Is there a possibility to use this format in Excel without writing any VBA code?

    Thanks
    -GH

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: number format like %g from C

    No. Excel native functionality does not have that format. You define how many decimal points you want to show. Omitting insignificant zeros is not an option without using VBA.
    Last edited by teylyn; 10-21-2010 at 06:56 AM.

  3. #3
    Registered User
    Join Date
    10-21-2010
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: number format like %g from C

    Alright. That was quick and easy.

    Thanks

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: number format like %g from C

    In der Kürze liegt die Würze!

+ 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