Select Page

Art of BI: C# Convert Decimal to String

Author: Christian Screen | | July 13, 2009

Microsoft usually has good documentation but on this particular topic, I always felt that it was lacking. Here is the MS core documentation for converting a decimal to a string, http://msdn.microsoft.com/en-us/library/59095yyw.aspx.

I recently needed to ensure that I was only getting only two decimal places on a dollar amount as I converted it into a string and was going to write a nice long post myself and then I found this really nice post over at csharp-examples (view post).

Mainly I was looking for the following syntax just to ensure that I was setting up things correctly:

// 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"

They have some other great custom formatting items as well. Check ’em out.

Oracle BI Publisher (BIP) Tips: Functions, Calculations & More

Check out these BI Publisher tips including functions & calculations so you can understand more about the production and support of BI Publisher reports.

Sherry Milad | January 15, 2018

Qlik vs. Tableau vs. Power BI: Which BI Tool Is Right for You?

Tableau, Power BI, and Qlik each have their benefits. What are they and how do you choose? Read this blog post for a quick analysis.

Tom Hoblitzell | June 6, 2019

How to Index a Fact Table – A Best Practice

At the base of any good BI project is a solid data warehouse or data mart.

Christian Screen | March 16, 2010

Subscribe to Our Blog

Never miss a post! Stay up to date with the latest database, application and analytics tips and news. Delivered in a handy bi-weekly update straight to your inbox. You can unsubscribe at any time.

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS