Ticket T144085
Visible to All Users

How to set the currency symbol on EditMask property - £ C2 (£ 2,234.23)

created 11 years ago

Hi Team,

I have a TextEdit control on Vertical grid view with EditMask as C2 where the user can enter the currency with two decimal values as suffix.

By default it is showing the "Pound" symbol probably because of the default settings but if some one uses my software where the Culture is set to English USA ($ symbol) then that would be the crap because the currency value varies across the world.

My question is, how should I show the specific currency symbol?

if I set the EditMask property to "#,##.##" then it will allow only 3digits, but the currency C2 will satisfies my requrement.

Please let me know how to overwrite the default currency symbol to the specific (£) symbol.

Thanks.

Hari C

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hello Hari,
As far as I understand, you would like to show the £ currency symbol instead of the symbol in the current culture. The simplest way to accomplish this is to set the following mask:

C#
this.textEdit1.Properties.Mask.EditMask = @"£###,###,###,###,###,###,###,###,##0.00";

It matches the longest number that you can input in TextEdit if you use the "C2" edit mask.
Also, you can manually change the culture to "en-GB" in the main method of your project. But in this case, the "en-GB" culture will be used for every user of your project.
Please let me know if this is helpful.

    Comments (2)

      Hi thanks for your information.
      Could you please tell me how to change the culture in the project.
      I will check and choose any of the given solution.
      Thanks.

      DevExpress Support Team 11 years ago

        Hello,
        To process your inquiry most efficiently, I've created a separate ticket regarding your last question:
        How to change the culture in the project.
        Please refer to it for further correspondence.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.