You know what’s annoying? Powerful API’s like .NET.

You know what’s even more annoying? When MSDN SUCKS~!!!!!

Formatting numbers in C#

Holy crap. I’ve had to rail on this again and again and every time I do.. I ask myself WTF is MSFT doing? I mean, they want people to use their API’s. Why don’t they get a crack team to document this stuff?

HOW IS this acceptable??? Don’t they have a QA team? I mean yes there’s a lot to document, but there’s also a lot of code to write to get the thing to work. If you’re going to get one thing right, you may as well get the other, otherwise all your effort probably is wasted because the vast majority of people (average developer I suppose, from what I see on these usenet and discussion board posts) won’t be able to use these nifty/neato functions that you’ve worked in here and they’ll be stuck creating crummy workarounds because no one uses these functions so nobody knows about them unless they really look..

    int x = 5;
    double y = 5;
    int z = 9492;
    string a = String.Format( "{0:00} {1:00} {2:00000}", x,y,z );
    Console.WriteLine( a );

    // outputs: 05 05 09492
    // 0:00 says:  The first 0 is which arg to match up with (in this case, x)
    // the :00 after that first 0 says "it must be 2 digits long, and if its not, pad it
    // with extra 0's.

msdn’s docs really blow.

Post a Comment