During a conversation on IRC, someone pointed out the following:
decimal.Parse(\"1.0000\").ToString() // 1.0000
decimal.Parse(\"1.00\").ToString() // 1.00
In addition to post I see here, I would personally add a side note:
always during persistence manipulations with floating point/decimal/double numbers consider the culture
you're in, or you're going to save in. The code like here written is first, but definitive pass to complete mess and non culture independent architecture.
Use Decimal.Parse (String, IFormatProvider).
In my opinion, that methods (Parse From/To
) that lack of Culture
parameter have to be removed from the library to force a developer to think about that very important aspect.