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 8253659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:57:04+00:00 2026-06-08T00:57:04+00:00

I am trying to use these on EF code first properties with MVC: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

  • 0

I am trying to use these on EF code first properties with MVC:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

Specifically:

[DisplayFormat(DataFormatString="##.##%")]
public double? PercentOfSomething {get;set;}

How do I get .2345 to display as 23.45% and .2 to display as 20%
In other words, only show the decimal, up to two places, if there is one.

As it is now, it just displays the format string “##.##%”. I am guessing maybe these types of format strings are not supported by the DisplayFormat attribute.

  • 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-08T00:57:06+00:00Added an answer on June 8, 2026 at 12:57 am

    I think you should use “{0:##.##%}” instead of just ##.##%

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

Sidebar

Related Questions

So I'm trying to use these CSS3 buttons taken from: http://lab.simurai.com/buttons/ Here is the
I am trying to use this plugin: http://docs.jquery.com/Plugins/Validation Where #user_new is the id for
I'm trying to use this code, and these instructions to do direct messages. Posting
I am trying to use this code in my QT app QMap<QString,QMap> but there
I am trying to use the peek function in Visual Studio 2010 with these
this is my first time trying to use java for backend web systems. I
I am trying to code simple membership class. First class name is Customer and
I'm creating a multi-tenant Asp.Net MVC 3 Web app, and using EF4.1 code first
I'm trying to use python ctypes to use these two C functions from a
I have a code-first, POCO project in which I am trying to adjust an

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.