C# String.Format for Double/Decimal Values

The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString.
Digits after decimal point

This example formats double to string with fixed number of decimal places. For two decimal places use pattern “0.00”. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.
[C#]

// just two decimal places
String.Format(“{0:0.00}”, 123.4567);      // “123.46”
String.Format(“{0:0.00}”, 123.4);         // “123.40”
String.Format(“{0:0.00}”, 123.0);         // “123.00

More examples are in the original article here…

Advertisement

Failed to create a CLSID_BizTalkPropertyBagFactory

Was getting this message, “Failed to create a CLSID_BizTalkPropertyBagFactory” when trying to refresh the Group Overview screen in the BizTalk 2006 Administration Console.

What was the answer? Restart the Windows Management Instrumentation service.

Thanks to Michael Stephenson’s blog for the answer…

http://geekswithblogs.net/michaelstephenson/archive/2007/09/01/115103.aspx

Sharepoint Crashing My Browser

I was having a heck of a time with Sharepoint. Every time I would click on a document, my browser would crash. The only way I was able to get a document to open was to right-click on it and open it in a new window. Needless to say, this was really annoying!

I found a Microsoft KB article that solved the problem.

http://support.microsoft.com/kb/929360

Just in case someone searches the interweb with the error code I was getting, it was: 0xc06d007f.

John

How to Install Pavers

We have had a project lined up to extend the patio in our backyard. We were thinking of just having it done with concrete, which is what our existing patio is made of.

After looking at different contractors for the job, it was way more expensive than we had hoped. Now, we are thinking of a do-it-yourself project using pavers. I installed a natural stone flower bed border around the front and side of our house and it turned out really well.

This project would be a little more involved in some ways, but easier in others.

How to Install Pavers – wikiHow

Maybe I’ll get some before and after pictures out here. 🙂

Nail Pops

We have a few places in our house where drywall nails are beginning to rear their ugly heads. I’ve never done this kind of work before, but it looks like it’s a pretty easy fix.

How to Fix Nail Pops in Drywall – wikiHow

We also have one area where the drywall tape is beginning to separate from the wall. I may need to undertake that project too.

How to Repair Drywall Tape That Is Separating from Your Walls – wikiHow

I actually know a great guy who does small drywall repair. I just know I can save a good bit of money if I do it myself. The materials themselves are really cheap.

Failed to create a CLSID_BizTalkPropertyBagFactory

Failed to create a CLSID_BizTalkPropertyBagFactory

We periodically will start getting this exception in the BizTalk Admin Console and it’s annoying to say the least. Previously, we would do a reboot not really knowing what was causing the problem. Well, the solution from this article worked for us. All we had to do was restart the Windows Management Instrumentation service and it started working again.

Still not sure what creates this condition, but this fix is easier than taking a production server down to reboot!

Yay!

John