Browse by Tags

Tagged Content List
  • Blog Post: CurrentCulture, CurrentUICulture and DateTime strings

    There are a lot of blogs out that that tries to explain which is what, and why it is the way it is. To those of you who just want to know what the results are. I wrote a quick little app to show what happens. As you can see, DateTime.ToString() formatting is driven purely by CurrentCulture. You can read...
  • Blog Post: .NET Format String 102: DateTime Format String

    "I see stuff like "zz" passed into DateTime.ToString(). What exactly does that do?" -- Very Confused DateTime String Formatter DateTime has its own set format string modifiers because there are so many ways to display a date and time. There are 2 things that affects how your DateTime is formatted...
  • Blog Post: .NET Format String 101

    "I see stuff like {0,-8:G2} passed in as a format string. What exactly does that do?" -- Very Confused String Formatter The above format can be translated into this: "{<argument index>[,<alignment>][:<formatString><zeros>]}" argument index : This represent which argument...
  • Blog Post: Array.Equals

    "I wish .NET can compare contents of an Array." - Annoymous Array Comparer Currently, when you compare two arrays with the = operator, we are really using the System.Object's = operator, which only compares the instances. (i.e. this uses reference equality, so it will only be true if both arrays points...
  • Blog Post: Rounding Up

    Since my last post, some people asked me "Well.. great... how do I round up?" Particularly since SQL doesn't do the same rounding as the CLR. SQL's default (and only) rounding algorithm is Rounding Up . i.e. SELECT ROUND(2.45, 2), ROUND(2.45, 1) GO SELECT ROUND(3.45, 2), ROUND(3.45, 1) GO SELECT ROUND...
  • Blog Post: Math.Round - MidpointRounding Enum

    I have received some requests to talk about how you can control rounding in Whidbey. So here we go.... :) In Everett, the CLR only support one type of rounding. The Math.Round uses Banker's Rounding Algorithm . (This is the algorithm banks use.. thus the name) This algorithm rounds to the near integer...
Page 1 of 1 (6 items)