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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:42:14+00:00 2026-05-31T19:42:14+00:00

Could someone please help me with the code for below requirement or scenarios…I achieved

  • 0

Could someone please help me with the code for below requirement or scenarios…I achieved 80 %, but stuck up with autoformatting…Its silly but new for me 🙁

Well my business user would like to feature for a big amount field textbox which should allow 2 decimal points only.i.e when she types 1000, it should be automatically formatted as “1,000.00” and when she types 1000000, it should be like “1,000,000.00” and when she types 1K, it should be formatted as automatically “1,000.00” and when she types 10000.23 it should be “10,000.23” and M/m should be million and b/B should be billion. Well I could achieve all these M/M, k/K etc and limitting the decimal only to 2 decimal points. Even I kept validation and all like it wont allow any characters except k/K,m/M,b/B,”.” and “,”. Please also remember, if user mentions just 2k, it should be “2,000.00” i.e I mean to say, if no values she keyin for decimal or no “.” in the number value in textbox, it should be that “number.00” against to 23333.32 which should appear as “23,333.32”

But I have a problem of implementing autoformatting the inputs with a coma for interval of every 3 digits starting from first digit to the left of decimal place. I am not sure how to do this autoformatting for coma… This should happen only when the user finishes keying in the input and presses tab. Please help me achieve this 🙁 I would be really greatful if you can share the sample code for me like above. (Please consider all scenarios I mentioned while we try for code for this) 🙂 Meanwhile I will also workout ways to achieve this…I know it might look silly to you, but new for me :(….thank you all….

  • 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-31T19:42:15+00:00Added an answer on May 31, 2026 at 7:42 pm
    String.Format("{0:0,0.00}", 12345.67); // 12,345.67
    String.Format("{0:0,0.00}", 12345.6); // 12,345.60
    String.Format("{0:0,0.00}", 12345); // 12,345.00
    
    String.Format("{0:0,0.##}", 12345.67); // 12,345.67
    String.Format("{0:0,0.##}", 12345.6); // 12,345.6
    String.Format("{0:0,0.##}", 12345); // 12,345
    

    When the text box loses focus:

    double value;
    
    if (double.TryParse(txtBox.Text, out value))
    {
        txtBox.Text = String.Format("...", value);
    }
    else
    {
        // Some code to handle the bad input (not parsable to double)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

could someone please help me out with the (simplified) code below. I'm trying to
Could someone please help me with the regexp javascript code to replace all <br
I'm relatively new to Cocoa/ObjC. Could someone please help me change my code to
Could someone please help me to understand what the 'send()' method listed below is
Could someone please help meto improve this part of code? The string is something
Could someone please help me in here, I'm just a beginner who want to
Could someone please help explain why I can't get this to work? I properly
I'm a newbie, could someone please help me what type is the Parts, I
Please could someone help me understand why the div.fl element shown in Developer Tools
I wonder whether someone could help me please. I'm using Image Uploader from Aurigma,

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.