Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:13:58+00:00 2026-05-25T12:13:58+00:00

What is the advantages between the syntax in C# (or other programmign languages) to

  • 0

What is the advantages between the syntax in C# (or other programmign languages) to displaying text in an application.

decimal fooTotal = 2.53;

For example:

Console.WriteLine("Filtered total: {0:c}", fooTotal);

VS

Console.WriteLine("Filtered total: " + fooTotal);

I see the first method in more examples and books (Current the MVC 3 book I’m going through) but I was taught method 2. I could hypothesize that method one would allow you to change values quickly? The first value would also be displayed in currency which I”m also assuming is more succinct ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:13:59+00:00Added an answer on May 25, 2026 at 12:13 pm

    The first form applies the c format specifier to the value, which treats it as a currency. To change the second snippet to behave similarly, you could use:

    Console.WriteLine("Filtered total: " + fooTotal.ToString("c"));
    

    I’ll often use string concatenation (the second form) for just a single parameter, but when I’ve got multiple values to include or I want to specify a format specifier, I’ll use string.Format or the equivalent. (Console.WriteLine effectively calls string.Format for you here.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The
Can somebody explain the main differences between (advantages / disadvantages) the two implementations? For
What is difference between Server.Transfer and Response.Redirect ? What are advantages and disadvantages of
What advantages does SQLServer CLR offer over T-SQL? Is using .NET syntax easier than
Are there any advantages compiling for .NET Framework 3.5 instead of 2.0? For example
What are the main differences, advantages and disadvantages between static and dynamic data structures?
What are the differences between static and external variables? What are the advantages of
what exactly is the difference (and advantages/disadvantages) between a fulltext index and a regular
What is the difference between these two innerclass declarations? Also comment on advantages/disadvantages? case
What are the differences between multi-module and single-module software architectures? What are the advantages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.