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

  • SEARCH
  • Home
  • 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 8745701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:04:34+00:00 2026-06-13T12:04:34+00:00

I am using Standard Numeric Format Strings and Custom Numeric Format Strings to show

  • 0

I am using Standard Numeric Format Strings and Custom Numeric Format Strings to show values.

In this case they want values like:

  • 123.0 to show as 123
  • 123.4 to show as 123.40
  • 123.44 to show as 123.44

That is, they want to show either zero or two decimals, never 1.

Now the first requirement I could solve by using “F0”. The second requirement I could solve by using custom numeric format string “0.00”. And the third case I could solve by using “F” (or “F2”). But in this case they want to handle all three cases in the same place. Is this possible by using some standard or custom numeric format string? Or do I need to create some special handling here?

  • 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-06-13T12:04:35+00:00Added an answer on June 13, 2026 at 12:04 pm
    Console.WriteLine((d % 1) == 0 ? "{0:F0}" : "{0:F2}", d);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a data grid I'm displaying numeric values formatted using a standard format string,
I am using standard String.Format method. It is using numeric objects. Console.WriteLine(obj1 = {0}
We can initialize a container deque by using standard input like this: deque<int> c((istream_iterator<int>(cin)),(istream_iterator<int>()));
How to do this using standard methods (without manual iteration through source string)? PS:
I have an application running under WebLogic that is using standard forms authentication. The
Using standard php5-pgsql driver it results to me that, at least with the default
I am writing a phone-like app with a custom numeric keypad. I would like
I'm generating QR codes using strings that could very easily be longer in length
I'm currently using standard Ant and I want to move to Ant4Eclipse (http://www.ant4eclipse.org/) to
Using standard mysql functions is there a way to write a query that will

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.