hi there,
i have a text box in a form to enter a float value.say that the user types in 1234567789.09 it should be formatted and display as 1,234,567,789.09 how can i do this. i am using a text box.
please can someone help me in this or give me some guidence???


thanxxxxx

You could perhaps consider a Masked TextBox.

how can i do it in a mask text box i looked at it there is no such thing in it to format money

myTextBox.Text = myFloatValue.ToString("#,###.00");

Will convert a float to the format you want. For input, set that as the mask in the textbox (not tested).

Edited 6 Years Ago by Momerath: n/a

myTextBox.Text = myFloatValue.ToString("#,###.00");

Will convert a float to the format you want. For input, set that as the mask in the textbox (not tested).

in mask text box the values are printed from left to right, so there will be extra spaces like
the user wants to type
234.90

it'll be like ___,___,234,90_.__

the user has to find the exact spce to type in the number
is there a way to type from right to left

thannxxx

in mask text box the values are printed from left to right, so there will be extra spaces like
the user wants to type
234.90

it'll be like ___,___,234,90_.__

the user has to find the exact spce to type in the number
is there a way to type from right to left

thannxxx

please can anybody help me with this thread


thankxxxx

This article has been dead for over six months. Start a new discussion instead.