This is a migrated thread and some comments may be shown as answers.

Unable to enter negative value to Numeric Mask Currency

2 Answers 245 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Mujaqo
Top achievements
Rank 1
Mujaqo asked on 08 Jul 2020, 12:29 PM
I’m using WinForms RadMaskedEditBox  MaskType: Numeric, Mask: c2, whenever I try to type negative number example: -$1.00 I get ($1.00), the minus sign - disappears and I get parenthesis () instead.
Is there a way to get negative currency number in MaskedEditBox?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 09 Jul 2020, 04:31 AM

Hi, Mujaqo,

NumberFormatInfo.CurrencyNegativePattern property sets the format pattern for negative currency values. Note that the default for InvariantInfo is 0, which represents "($n)". Please refer to the following article for more information: https://docs.microsoft.com/en-us/dotnet/api/system.globalization.numberformatinfo.currencynegativepattern?view=netcore-3.1.

It seems that on your machine is the default value, this is why you see the negative values with "()". In order to change this setting, you can do it through your local Region settings. In the Negative currency format filed you can choose from the drop-down the appropriate pattern that you would like to use. Below is a picture for your reference:

Another way is to set it programmatically via the CultureInfo class.

This is the result on my end:     
   

I hope this information helps. Do not hesitate to contact us if you have other questions.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Mujaqo
Top achievements
Rank 1
answered on 09 Jul 2020, 07:55 AM
Thank you so much, it worked perfectly.
Tags
MaskedEditBox
Asked by
Mujaqo
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Mujaqo
Top achievements
Rank 1
Share this question
or