We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Make negative number appear inside parentheses?

Thread ID:

Created:

Updated:

Platform:

Replies:

120110 Sep 1,2015 11:02 AM Sep 3,2015 01:01 AM WPF 4
loading
Tags: DoubleTextBox
laura
Asked On September 1, 2015 11:02 AM

What property of the DoubleTextBox can I make the negative numbers appear in parentheses, preferably red also?

laura
Replied On September 1, 2015 12:11 PM

I have figured out that if I use CurrencyTextBox then both the parentheses and the foreground being red can be achieved easily.

But unfortunately, CurrencyTextBox does not have properties for minimum decimal places and maximum decimal places.  Some of the input boxes, our clients want to leave the number of decimal places open so they can decide on an individual basis how many decimal places they want to put into the input boxes.  With CurrencyTextBox, I'm having a hard time seeing how this is possible. 

In other words, I would like to make the CurrencyTextBox be able to not have a set number of decimal places so that our clients can put in, say, 3.4 or 3 or 3.45 or 3.456.  They also do not want trailing zeros so setting the decimal places to something big does not work.

Please help?

Victory Jessie Selvam D [Syncfusion]
Replied On September 2, 2015 08:37 AM

Hi Iaura,

Thank you for using Syncfusion products.

Query #1: What property of the DoubleTextBox can I make the negative numbers appear in parentheses, preferably red also?
We can make the foreground color as Red for negative numbers using NegativeForeground and ApplyNegativeForeground properties in DoubleTextBox. For parentheses, set NumberNegativePattern=0 in DoubleTextBox.NumberFormat property.

Query #2: But unfortunately, CurrencyTextBox does not have properties for minimum decimal places and maximum decimal places. In other words, I would like to make the CurrencyTextBox be able to not have a set number of decimal places so that our clients can put in, say, 3.4 or 3 or 3.45 or 3.456. They also do not want trailing zeros so setting the decimal places to something big does not work.
Currently our CurrencyTextBox doesn't have support for MinimumNumberDecimalDigits and MaximumNumberDecimalDigits so that we cannot remove trailing zeros in decimal places of CurrencyTextBox. We have prepared a sample that tries to meet your requirement in DoubleTextBox and you can download it from the following link,

Sample: DoubleTextBox_Support

Please let us know if you need further assistance on this.

Regards,
Jessie

laura
Replied On September 2, 2015 10:42 AM

Thank you, good sir.  Your provided sample works perfectly to what we need.

Victory Jessie Selvam D [Syncfusion]
Replied On September 3, 2015 01:01 AM

Hi Iaura,

Thank you for your update.

Please let us know if you have any query.

Regards,
Jessie

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;