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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:05:19+00:00 2026-05-12T06:05:19+00:00

Platform: C# ASP.NET 3.5 I have a ListView which builds a Rate field which

  • 0

Platform: C# ASP.NET 3.5

I have a ListView which builds a Rate field which is decimal, if I simply have <% #Eval("Rate") %> it shows 4.5000 rather than 4.5 if I use <% #Eval("Rate","{0:#.##}") %> it shows 4.5 but doesn’t display 0

any suggests on how to bind the decimal field but still show 0

Thanks

Lee

  • 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-12T06:05:19+00:00Added an answer on May 12, 2026 at 6:05 am

    Using #.## in the format means it should hide 0. Use 0.00 instead:

    <%# Eval("Rate", "{0:0.00}") %>
    

    See these examples:

    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"
    String.Format("{0:0.##}", 123.4567);   // "123.46"
    String.Format("{0:0.##}", 123.4);      // "123.4"
    String.Format("{0:0.##}", 123.0);      // "123"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web based ASP.net platform which serves many thousands of clients per
I have downloaded the ASP.NET MVC 2 Release version (using Web Platform Installer) as
Coding Platform ASP.NET 4.0 WebForms on IIS7.5 If I request a page blahblah.aspx which
I have a large ASP.NET website on a hosted platform. It shares the machine
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
Platform: ASP.NET 3.5, ASP.NET Ajax intermixed I'm very green to jQuery, so have been
I have an existing asp.net c# application for which I'd like to implement a
I have a rather complex legacy ASP.Net application that is under continuous development, and
We have a white-labelled platform built on Asp.Net MVC2. At present the site has
I recently installed ASP.NET MVC 3 via web platform installer. I don't have the

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.