|
In my win-form, I am binding a textbox to a property, populated through my object. The property returns a number. Let's say 55.5 I want to add a % sign at the end of this 55.5 without changing the decimal or any of the significant figures. How can i do it?
Here is what i know so far: In the binding panel in the text property, under the "Format type" menu, there is a "Custom" option. It has Custom format textbox. If we put the % sign in here in a correct way, it will just be added to the end of the value of the property. So far, 0.0% or 0.00% has not worked as it changes the decimal and significant figures.
Any insight will be appreciated. | | |
AlanPosted Aug 27, 2007, 4:24 PM
The % sign has a special meaning in custom numeric formats in that it causes the number to be multiplied by 100 before it is formatted. I think you therefore need to place it in single quotes so that it's treated as a literal.
So, if you want all numbers formatted to one decimal place, I'd try a format string of :
"0.0'%'"