Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > number updown customising
 

number updown customising

Hiya folks

is there any way to get a numberupdown text to show the value "+" so if the value is a positive number then it adds the plus sign in front of the digits.

example:

2.00 would become +2.00
3.25 would be +3.25
as when its negative its
-2.00
-3.25

It already adds the negative value when its negative of course.

Liam
rimlesskid  Tuesday, September 29, 2009 7:59 PM

Hi rimlesskid,

You can create a function to format the number to what you want. This is the code snippet:
private string GetNumberString(double number)

{

if (number > 0)

return "+" + number;

else

return number.ToString();

}

Regards,
Aland Li


Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, October 01, 2009 8:10 AM

Hi rimlesskid,

You can create a function to format the number to what you want. This is the code snippet:
private string GetNumberString(double number)

{

if (number > 0)

return "+" + number;

else

return number.ToString();

}

Regards,
Aland Li


Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, October 01, 2009 8:10 AM

You can use google to search for other answers

Custom Search

More Threads

• Create computed datagridviewcolumn
• DataGridView...
• What can i do for my application to be installed without poping up "Do you want to trust this application" message on vista and win7 and so on?
• IndexOutOfRangeException in Datagrid based on DataView
• DataGridView row height when using AutoSizeRowsMode AllCells
• Build Class that when I use it; Property "Anchor" of All controls in my form set to "None".
• Combining Info from Two List Boxes
• Databinding / Currency Manager problem, I think?
• ´DataGridView: Sort, then Edit, then Error
• Please delete this thread