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

RadMaskedEditBox enter currency values without currency symbol without currency symbol

8 Answers 549 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Catalin
Top achievements
Rank 1
Veteran
Catalin asked on 25 Sep 2012, 10:30 PM
Hello,

In an application I need to enter some large numbers and the client wants to format the number as he types (add currency, thousands separator,etc). I tried to use RadMakedEditBox with the "f" mask, it does not respect culture, I tried using "c" mask, it kinda works but I need to get rid of the currency symbol. With the "c" mask I can change the currency symbol but I am unable to change it to String.Empty as I wish - the control crashes (the closest thing is to set " " - a single space - but it's not very pretty, the client does not accept that).

Is there any way to format the value using culture parameters without currency sign? I also tried working with "p" format but I didn't find a way to hide the percent sign. I seen another thread with a suggestion for using a spinner, that is not good for me.

Thank you.

8 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 28 Sep 2012, 08:53 AM
Hello Catalin,

Thank you for writing.

You can use the "n" mask which is for number and will format the entered number while typing. More information about numeric masks is availalbe here: http://www.telerik.com/help/winforms/editors-maskededitbox-numeric-masks.html.

I hope this helps.
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Catalin
Top achievements
Rank 1
Veteran
answered on 28 Sep 2012, 04:27 PM
Thank you Stefan, thet did the trick.
0
Mark
Top achievements
Rank 1
answered on 09 Aug 2016, 02:24 PM

Hi,

I know this is an old post, but I wonder if I could get a little more info on this?

I am looking for exactly the behaviour requested, currency without the currency symbol. If I use n (or n2) I don't get the forced decimal places displayed like a currency, so 4.00 is displayed as 4

If I use f2 I get 4.00, however I really want the value grouping you get with currency and "n" masks for usability.

I have tried custom masks (#, etc.) but it doesn't look like these are supported.

Is it possible to get a value with static decimal places and value grouping:

1,222.30

Many thanks,

Mark.

0
Catalin
Top achievements
Rank 1
Veteran
answered on 09 Aug 2016, 10:02 PM

Hello Mark,

We ended by using currency mask and overriding the current culture currency symbol to return a single space (something like customCulture.NumberFormat.CurrencySymbol = " "; ).

Like as I said in the original post, it's not very pretty (we have a space instead of currency symbol) but this is acceptable for my client. You can also try to set the CurrencySymbol to en empty string (I think that will be the ideal situation for you), maybe your version of telerik controls allows this scenario.

Have fun,

Catalin.

 

0
Hristo
Telerik team
answered on 10 Aug 2016, 02:21 PM
Hello,

Thank you for writing.

I think that setting the MastType to Numeric and specifying "N" as your Mask could bring the desired result:
public Form1()
{
    InitializeComponent();
 
    this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
    this.radMaskedEditBox1.Mask = "N";
}

I am also sending you a gif file showing how the masked edit box looks on my end. 

I hope this helps. Please let me know if you need further questions.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Catalin
Top achievements
Rank 1
Veteran
answered on 10 Aug 2016, 03:48 PM

Hello Hristo,

As I said in the original post, "f" and apparently "N" masks does not respect culture settings, your example works for us-english and likes cultures but not for french for example.

Am I wrong?

 

Best regards,

Catalin.

0
Mark
Top achievements
Rank 1
answered on 11 Aug 2016, 10:22 AM

Hi,

 

This does work OK for the Mask during data entry, however when I exit the textbox the .00 are not displayed.

I need the .00 to persist for display.

Thanks.

Mark.

0
Hristo
Telerik team
answered on 15 Aug 2016, 12:39 PM
Hello,

Thank you for writing.

@Catalin. I have tested with a system having French regional settings as well with modifying the Culture property of RadMaskedEditBox to be French. I am sending you a short video showing the result on my end. Please note that I have tested with the latest version of the suite. In case you keep experiencing the issue please open up a support ticket and send us your project.

Mark`s question will be answered in the ticket he has opened. Once we reach to a solution I will also update  thread.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
MaskedEditBox
Asked by
Catalin
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Catalin
Top achievements
Rank 1
Veteran
Mark
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or