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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:26:41+00:00 2026-05-30T20:26:41+00:00

I have an amount field which is a decimal in the database. I need

  • 0

I have an amount field which is a decimal in the database.
I need to always display this amount with 10 numbers on the left of the decimal and two after.

Example:
Amount = 245.00 which should display as 0000000245.00
Additionally, the amount could be over 1,000 or 10,000 which should display as:

0000001245.00 and 0000011245.00

How can I format the amount to always have the appropriate number of zeros on the left side of the decimal with a variable amount size?

  • 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-30T20:26:43+00:00Added an answer on May 30, 2026 at 8:26 pm

    You should put 0’s in your format string. Something like this.

    myValue.ToString("0000000000.00");
    

    That will always give you 10 digits on the left side of your decimal point and two on the right.

    If you do not want two digits on the right side… do this.

    myValue.ToString("0000000000.##");
    

    This says hey if we have a value display it; otherwise, skip it.

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

Sidebar

Related Questions

I have a BigDecimal field amount which represents money, and I need to print
I have two xmls.There is a amount field which can contains values like 54.2,54.23,54.234,54.234567.
I have two fields - amount (decimal (11, 2)) - gift_amount (decimal (11, 2))
I have collections with huge amount of Documents on which I need to do
I have a column in my database, which is the ColorCode column (Field name
I have a large amount of data I need to store, and be able
I have some (small amount) of data that I'll need quick access to on
I have a large amount of data in a database. When I attempt to
We have a situation in which we need to update records based on existing
I have an int field in my product table called product_stat which is incremented

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.