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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:12:46+00:00 2026-05-24T03:12:46+00:00

I am use the textbox value like 1455.23 , use the round function my

  • 0

I am use the textbox value like 1455.23, use the round function my output is 0000145523 but customer not enter float values like 1234 my output is 0000123400 pls give me suggestion
my code is format.cs

public bool formatAmount(float flAmount, out string strOutput)
{
  bool bval = false;
  float rounded = (float)Math.Round(flAmount, 2);
  if(rounded!=null)
  {
    flAmount = flAmount * 100;
    strOutput = Convert.ToString(flAmount);
    bVal = true;
  }

  return bVal;
}

In my asp page code like this

string ods;
float a = Convert.Todecimal(txtSSA.Text);
string sss = oclsUtility.formatAmount(a, out ods);
  • 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-24T03:12:47+00:00Added an answer on May 24, 2026 at 3:12 am

    If I’m understanding you, you need to keep leading 0 if user input is float and if not removes them. You can try this:

    int number;
    bool result = Int32.TryParse(rounded, out number);
    if (result)
    {
        // Your number will contain the number with no leading 0
    }
    else
    {
        // Then you have a float.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use autocompletebox with a list of values, but also add
Should I use textbox.text.Trim() function every time when I insert any data from web
I would like to use databinding when displaying data in a TextBox. I'm basically
I would like to edit a graphical text (not a TextBox control) through the
I have a textbox (I usually call it like this: document.forms[0].text.value ) that has
I have this textbox I use to capture keyboard shortcuts for a preferences config.
can I add BehaviorID attribute for asp.net textbox and use it to be recognize
The WPF TextBox natively makes use of the System Highlight color for painting the
When you use a Windows Forms TextBox, the default number of tab stops (spaces)
How do I use the jQuery Datepicker with a textbox input: $(#my_txtbox).datepicker({ // options

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.